XML and PHP
- Started
- Last post
- 6 Responses
- fugged
I'm looking for an easy way to parse XML using PHP. Mostly for navigation/structure on a Web site. It'd be nice to have something that would parse the XML and spit out an associative array of some sort so I can write methods for recursing though and spitting out the HTML for the menus.
Any suggestions? I'm a complete PHP n00b...
Thanks!
- instantok0
http://minixml.psychogenic.com/
pretty easy to use
- enobrev0
that minixml looks pretty good...
been using this for a while:
http://www.devdump.com/phpxml.ph…
which is based on php's expat parser.
- moth0
i tried this and never got anywhere :(
- fugged0
Thanks instantok. This looks like just what I need.
I've tried using it, but when trying to load an XML document, I get this error returned:
"The specified CGI application misbehaved by not returning a complete set
of HTTP headers"I suspect it's something with the configuration of the server? It happens even with the examples they unclude...
Anyone have any ideas on wtf? =)
- unfittoprint0
don't forget the follwoing:
//indicate your file's headers
//before of everything
header("Content-type : text/xml");//if u use utf-8 encoding
//encode your whole output
echo utf8_encode($xml);
- fugged0
damn. tried the same code on an apache server and it worked just fine. did find this though
http://bugs.php.net/bug.php?id=2…
Maybe it's just a bug with IIS.
Thanks for the responses everyone.