Parsing RSS Feeds with PHP

pradeep's Avatar author of Parsing RSS Feeds with PHP
This is an article on Parsing RSS Feeds with PHP in PHP.


RSS is a family of web feed formats used to publish frequently updated content such as blog entries, news headlines or podcasts. An RSS document, which is called a "feed," "web feed," or "channel," contains either a summary of content from an associated web site or the full text. RSS makes it possible for people to keep up with their favorite web sites in an automated manner that's easier than checking them manually.

In this article we'll see how to parse RSS Feeds using the PEAR package XML_RSS.

Installing the PEAR package

Issue this command in the command line,
pear install --alldeps XML_RSS

Sample Code

Code: PHP
 $feed_uri = "";
 $rss =& new XML_RSS($feed_uri);
 print("<h1>New PHP articles from <a href=\"\">Go4Expert</a></h1>\n");
 foreach ($rss->getItems() as $item)
    printf("<li><a href=\"%s\">%s</a></li>\n",$item['link'],$item['title']);
jhbalaji's Avatar, Join Date: Jul 2010
Newbie Member
I hope simply we can use SimplePie their documentation teaches you a lot too
shrikrishnatech's Avatar, Join Date: Nov 2010
Go4Expert Member
thanks for the code but it is working with Working with multiple feeds?