note 14624 added to function.xml-parse-into-struct.php
| From: | bob at microNOSPAMtech dot com | Date: | Tue, 07 Aug 2001 00:16:41 +0000 |
| Subject: | note 14624 added to function.xml-parse-into-struct.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-16417@lists.php.net to get a copy of this message | ||
I took gdemartini@bol.com.br's example along with nyk@cowham.net's addition and wrote up a
little function to see exactly what is in the struct.
function ShowXMLTree($tree, $depth)
{
foreach($tree as $key => $value)
{
if(is_array($value))
{
ShowXMLTree($value, ++$depth);
}
else
{
for($i=0; $i<$depth; $i++)
{
echo " ";
}
echo "tree[\"$key\"]==\"$value\" <br>";
}
}
}
// So you could do something like this:
$tree = GetXMLTree ("XML_test.xml");
ShowXMLTree($tree, 0);
http://www.php.net/manual/en/function.xml-parse-into-struct.php