PHP RSS Feed Reader using Curl-PHP RSS parser
Posted by Raj
PHP RSS Feed Reader using Curl-PHP RSS parser
In this article,I will explain how to Read RSS feed in php.I have used PHP Curl library to parse RSS feeds with PHP.we can covert rss feed to content using PHP.
Please check below php rss reader example:
<?php
//Used cURL to get the RSS feed into a PHP string variable
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'http://example.php/rss.xml');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$xml = curl_exec($ch);
curl_close($ch);
$return_data = new SimpleXmlElement($xml, LIBXML_NOCDATA);//I have used the
SimpleXML PHP functions to parse XML documents
$items = count($return_data->channel->item);
for($i=0; $i<$items; $i++)
{
$desc = $return_data->channel->item[$i]->title;
$desc = $return_data->channel->item[$i]->link;
echo $desc = $return_data->channel->item[$i]->description;
}
?>
In this article,I will explain how to Read RSS feed in php.I have used PHP Curl library to parse RSS feeds with PHP.we can covert rss feed to content using PHP.
Please check below php rss reader example:
<?php
//Used cURL to get the RSS feed into a PHP string variable
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'http://example.php/rss.xml');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$xml = curl_exec($ch);
curl_close($ch);
$return_data = new SimpleXmlElement($xml, LIBXML_NOCDATA);//I have used the
SimpleXML PHP functions to parse XML documents
$items = count($return_data->channel->item);
for($i=0; $i<$items; $i++)
{
$desc = $return_data->channel->item[$i]->title;
$desc = $return_data->channel->item[$i]->link;
echo $desc = $return_data->channel->item[$i]->description;
}
?>
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
parse xml,
php rss,
php rss feed reader,
php rss reader,
php rss reader example,
read rss,
read rss feed in php,
reader rss,
rss news feed,
rss php,
rss read,
rss reader,
rss to content
.You can leave a response, or trackback from your own site.