[thelist] [XML/PHP] Getting PHP to convert 'blogger' generated XML into an array.

Matt McKeon matt at camadro.com
Fri May 30 10:29:30 CDT 2008


Tris wrote:
> I've been tasked with converting this:
> http://www.makersmark.co.uk/blog/atom.xml
> into an array...
> 
> each time I try I get nothing.
> 
> I've validated the XML, it's good.
> 
> Has anyone before me succesfully exported a blogger XML file and
> parsed it n PHP?
> 
> Tris..

If your on PHP5, you may use SimpleXML 
<http://us3.php.net/manual/en/book.simplexml.php>.
There's also backport of it to PHP4 here 
<http://www.ister.org/code/simplexml44/index.html>.

It makes things pretty easy, and you can easily convert it to an array. 
You also might want to check out a PEAR or PECL lib for parsing XML.

HTH



More information about the thelist mailing list