Due to updates, over time, that have been made to the site and the age of this article, this post may not display correctly. In particular images may be missing or product reviews display incorrectly.

If this is the case and you'd particularly like me to fix it, then please reach out to me on Twitter.

After using the JavaScript only and generally pretty poor facility within Feedburner to embed RSS feeds onto a website, I set about an alternative solutions.

Thankfully, there are a number available. However, many offer little embedding options and I wanted something that gave me full control. This narrowed it down to 2 free downloadable scripts. However, as much as I tried I couldn’t get them to work properly.

Everything went well until it came to a link in my item description – then the less than/greater than signs would mysteriously disappear. Bizarrely, if I used the option to run it from the authors script from their site, it worked. So I can only assume it’s a configuration on my server. However, I’ve not been able to work out what it is.

Now, PHP has built in XML parsing options and this is what these scripts were using – and I’m guessing the configuration option in question was to do with that. So I gave up and decided to write my own alternative. It doesn’t use XML parsing but simply reads the whole file in and extracts the details I need – in this case title, description and date. The code is below – pass the RSS feed into it by assigning it to the variable $rss_feed.

I’ve left some of the code expanded – for example there is no need for each field to be calculating and storing the end position as this could simply be placed within the length calculation. However, so you can see what I’m doing I’ve left it as it is.

So, during each iteration you will have 3 fields available for you to use, and probably display. They are $title, $pubdate and $description. $pubdate is converted into a more readable format using the date command, but the parameters can be easily changed to format it in another way.