I have this script which outputs an rss feed. Want I want to do is have it attempt to reach the rss url for something like 5 sec tops, and if it cannot then I want it to loa
This is what I got working:
channel->item as $item) {
echo '', substr($item->title, 0, 62), '...
', substr($item->pubDate, 4, 18),'
';
}
} else {
$myFile = "content/backUpXml.xml";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $xml;
fwrite($fh, $stringData);
fclose($fh);
$xml = simplexml_load_file($url);
foreach ($xml->channel->item as $item) {
echo '', substr($item->title, 0, 62), '...
', substr($item->pubDate, 4, 18),'
';
}
}
?>