philej
Dec 7th 2005, 8:58 pm
I was playing with RSS feeds in PHP5 and found this to be very cool. :)
This simple function will print out a linked title for every item in your feed.
// $location = URL of feed.
function load_xml_feed($location)
{
$feedXml = simplexml_load_file($location);
foreach ($feedXml->channel->item as $article)
{
print '<a href="' . (string)$article->link . '">' . (string)$article->title . '</a><br>';
}
}
This simple function will print out a linked title for every item in your feed.
// $location = URL of feed.
function load_xml_feed($location)
{
$feedXml = simplexml_load_file($location);
foreach ($feedXml->channel->item as $article)
{
print '<a href="' . (string)$article->link . '">' . (string)$article->title . '</a><br>';
}
}