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 WordPress.org 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.

Published by Arjun

I am Arjun from Hyderabad (India). I have been working as a software engineer from last 7+ years, and its my passion to learn new things and implement them as a practice. Aside from work, I likes gardening and spending time with pets.

Leave a comment

Your email address will not be published. Required fields are marked *