<?php
$connect = curl_init("http://www.unixsite.com/feed/rss/");
curl_setopt($connect, CURLOPT_RETURNTRANSFER, true);
curl_setopt($connect, CURLOPT_HEADER, 0) ;
$result = curl_exec($connect);
curl_close($connect);
$data = new SimpleXmlElement($result, LIBXML_NOCDATA);
for($i=0;$i<10;++$i) {
if(empty($data->channel->item[$i]->title)) break;
echo $data->channel->item[$i]->title;
echo $data->channel->item[$i]->description;
}
?>
There are several ways to read RSS feed in PHP, but this one is surely one of the easiest.
channel->item as $entry) {
echo “link’ title=’$entry->title’>” . $entry->title . “”;
}
?>
Source:
http://phphelp.co/2012/04/23/how-to-read-rss-feed-in-php/
OR
http://addr.pk/a0401