hebig.org/blog

2004May12
Current in Photos « Previous EntryHomeNext Entry »

XML with PHP4, PHP5

KEITH DEVEN'S XML LIBRARY FOR PHP4
"The library gives you two functions, XML_unserialize() and XML_serialize(). XML_unserialize() takes an XML document and returns a PHP data structure, and XML_serialize() takes a PHP data structure and returns an XML document. Real easy. I've also provided an XML to PHP translator that lets you test it out." It will get even better with PHP5:


PROCESSING LARGE XML DOCUMENTS WITH PHP 5
The Bitflux Blog on Processing Large XML Documents with PHP 5 describes how the title of a weblog entry with a specific ID has been extracted from a 10 MB XML file. "To sum up: XMLReader is a powerfull extension to parse large XML documents, it's usually much faster than SAX (twice as fast), while still scaling without problems on the memory side. With the expand() method, it's now also possible to mix the features of DOM/SimpleXML/XSLT with XMLReader, if you only have to process parts of an XML document."


MORE PHP5 XML GOODIES
Christian Stocker: Workshop: XML in PHP5
Simon Willison: XML highlights for PHP 5
Adam Trachtenberg: Using PHP 5's SimpleXML
And related, for even niftier access to document elements: Tidying up [and parse, and clean, and extract] your HTML with PHP

Entry first published 2009-05-18 01:00, last edited 2009-05-18 01:00
Share this entry via e-mail - on Twitter