Creating an RSS 2.0 Feed with PHP
As RSS 2.0 is a well-established standard nowadays and a lot of people actually use it, it is quite useful sometimes to create an RSS feed for a blog or a news section. When creating the new ExpatTech TechBlog I really wanted to implement this feature, so I digged into the topic a bit.
The first important thing to know that an RSS is actually an XML document, so you have to comply with the XML standards, and also RSS has a well-defined standard structure that you want to follow. One nice tool is W3C's Feed Validation Service to check your feed.
Of course I wanted to generate the RSS using PHP, because the whole site uses this technology. On websites the recommended charset is UTF-8, so for the examples I will use that.