<br>$cache="phpnews.xml"; <br>$rssurl="http://www.php.net/news.rss"; <br>header("content-type:text/html;charset=utf-8"); <br>if( file_exists("$cache") ) <br><br>{ <br><br>$m=filemtime("$cache"); <br><br>$n=time(); <br><br>if($n-$m>10800) <br>{ <br>$rss=simplexml_load_file("$rssurl"); <br>$rss->asXML("$cache"); <br><br>} <br>else <br>$rss=simplexml_load_file("$cache"); <br> <br>} <br><br>else <br>{ <br>$rss=simplexml_load_file("$rssurl"); <br>$rss->asXML("$cache"); <br><br>} <br><br> <br>foreach($rss->item as $item) <br><br> <br>print "<a href="%24item->link" target="_blank"> $item->title </a><br>n"; <br><br> <br><br>?>