A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

PHP 4 XML

DOM XML
http://www.php.net/manual/en/ref.domxml.php
(for PHP 5, use DOM)

Create a Document object from a file:

$doc = xmldocfile("myfile.xml");
if ($doc){
print $doc->dumpmem();
}


NOTE: PHP must be compiled with --with-dom and --with-xml.
phpinfo() will display this information right at the top.

The PHP 4.4.9 (Zend Engine) that comes with Mac OSX is not compiled --with-dom.