Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $cachetime=0; // 12 Hours
- $cachefile = 'cache/horoscope.txt';
- if(!file_exists($cachefile) || filemtime($cachefile) < time() - $cachetime) {
- $xml = simplexml_load_file("http://www.vytautus.com/hor_rss.xml");
- $i=1;
- foreach ($xml->channel->item as $item) {
- $horoscope .= '<p>'.(string)$item->description.'</p>';
- $i++;
- }
- file_put_contents($cachefile, $horoscope);
- }
- $horoscope = file_get_contents($cachefile);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement