It is very easy to parse RSS and print out all information of RSS as following
All we need is calling function simplexml_load_string
$rss = '';
$url = "http://www.dantri.com.vn/Sukien.rss";
$rss_file = file_get_contents($url);
if(!$feed = simplexml_load_string($rss_file)){
die("Cannot load RSS Feed. This application supports RSS 1.0 and 2.0");
}
// print out the title of the feed
echo '';
';
echo $feed->channel->title;
echo '
// check for RSS Version
$items = ($feed['version'] != '') ? $feed->channel->item : $feed->item;
// PRINT OUT ITEMS
/*---------------------------------------------------------------------------------------*/
foreach($items as $item)
{
echo $item->description.'
';
}
/*---------------------------------------------------------------------------------------*/