note 8741 modified in function.xmltree by irchtml
| From: | irchtml@php.net | Date: | Tue, 24 Feb 2004 09:06:07 +0000 |
| Subject: | note 8741 modified in function.xmltree by irchtml | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-65639@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.
--was--
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/en/function.xmltree.php