The SimpleXML extension is the tool of choice for parsing an XML document. The SimpleXML extension requires PHP5 and includes interoperability with the DOM for writing XML files and built-in XPath support. SimpleXML works best with uncomplicated, record-like data, such as XML passed as a document or string from another internal part of the same application. Provided that the XML document isn’t too complicated, too deep, and lacks mixed content, SimpleXML is easier to code than the DOM, as its name implies. It is also more reliable if you work with a known document structure.
(Link: XML for PHP developers, Part 1: The 15-minute PHP-with-XML starter)
XML for PHP developers, Part 1: The 15-minute PHP-with-XML starter
Advertisement


July 13, 2009

No comments yet... Be the first to leave a reply!