PHP – RSS XML Read

This php example helps you to read the RSS XML data in simple manner.

Code Example:

<?php
$url = "http://www.phpmoot.com/feed/";
$xml = simplexml_load_file($url);
for($i = 0; $i < 10; $i++){
	$title = $xml->channel->item[$i]->title;
	$link = $xml->channel->item[$i]->link;
	$description = $xml->channel->item[$i]->description;
	$pubDate = $xml->channel->item[$i]->pubDate;
	$html .= "<a href='$link'><h3>$title</h3></a>";
	$html .= "$description";
	$html .= "<br />$pubDate<hr />";
}
echo $html;
?>

Post to Twitter Post to Digg Post to Facebook Post to Google Buzz Send Gmail