Posts Tagged ‘simplexml’

Tips to Ensure Your XML RSS Feed is Valid

Saturday, March 15th, 2008

Last month, I wrote on article on creating an RSS feed for your site. Some people have reported problems with the process – but these all come from malformed XML, not the PHP code supplied in the article.

There are a few things you need to keep in mind while writing an XML document, or else the RSS reader will not be able to understand it. It’s better to think of writing XML as writing code than text, because there are some strict syntax rules you need to adhere to.
(more…)

RSS Feed: Building an RSS Data Feed in PHP with SimpleXML

Thursday, February 21st, 2008

RSS feeds are a must-have for modern websites. It’s easy enough to make an RSS feed of recent articles in PHP. But did you know an RSS feed can simply be information – not links to articles?

This article will look at how to build a basic feed of data – for our purposes, we’ll consider random quotes. It will also illustrate how to use SimpleXML to build the feed for us.
(more…)

How to Access XML Attributes in PHP Using SimpleXML

Friday, February 15th, 2008

A user on Programming Talk had a problem the other day. He was trying to build an XML parser to work with an xml data file (a character sheet from the WoW Armory).

His parser wasn’t working – because all of the information was stored in attributes instead of child elements. What’s the difference between the two? And how can we fix it?

Use SimpleXML.
(more…)