Reading RSS Feed with PHP

/ By Arjun / Published on March 23, 2016

This article shows how to read RSS feeds using php script. If you are reading this post you might know about RSS feeds and it’s benefits. It is good to display your blog feeds as like recent articles list to keep people in the loop.

As you know RSS feed data is in XML format. fortunately PHP 5 introduced the DOM extension which make it easy to work with XML data. You can also use simplexml_load_file() function instead of DOM extension, which will interprets an XML file into an object.

Reading RSS Feed with PHP

The following code will create a new DOMDocument() object and into we will load the RSS feed and we will store the response in $feeds variable.

Now you can iterate over the $feeds data and display the results as you wish. That is it.

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x