Generating RSS Feeds using SimpleXML in PHP

Ever felt the need to generate RSS feeds for any of your projects. If you are wondering what feeds are then here is a link from Wikipedia for you. Basically an RSS feed is an XML document that follows a certain XML structure for publishing news and article updates related to a site or blog. This XML structure is standard for all devices, be it mobile or web or a desktop feed reader.

But how would you generate such document? Well, PHP does have a sufficient XML library called SimpleXML. It comes with latest PHP package so no need to install it separately. We can generate RSS Feeds using SimpleXML in PHP using the following code.

alexey

Application developer, movie buff, occasional reader and a huge Manchester United fan.
alexey

Application developer, movie buff, occasional reader and a huge Manchester United fan.