note 8741 added to xmltree

From: Date: Tue, 26 Sep 2000 16:27:47 +0000
Subject: note 8741 added to xmltree
Groups: php.notes 
Request: Send a blank email to php-notes+get-5444@lists.php.net to get a copy of this message
The xmltree function does exactly what it says it does. That is, it creates a bunch of PHP objects from the internal DOM representation of an XML document. The following example (without error checking) may give you some ideas about how you can use it. (The print_r() function is marvelous for finding out about the structure of PHP "things".) <?php $fd = fopen("a.xml","r"); $myXML = fread($fd,filesize("a.xml")); fclose($fd); $docTree = xmltree($myXML); print("<pre>"); print_r( $docTree ); print( "</pre>" ); ?> This will print out a representation of the PHP objects which are created from the in XML in the variable $myXML. The file a.xml contains at least well-formed xml markup. http://www.php.net/manual/function.xmltree.php

« previous php.notes (#5444) next »