note 71692 deleted from function.tidy-node-get-nodes by danbrown
| From: | danbrown@php.net | Date: | Mon, 04 May 2009 12:58:29 +0000 |
| Subject: | note 71692 deleted from function.tidy-node-get-nodes by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154184@lists.php.net to get a copy of this message | ||
Note Submitter: brutuscat at gmail dot com
----
Another method more efficient
<?php
function get_nodes2($node, $type, &$result)
{
if($node != null)
{
if($node->id == $type)
$result[] = $node;
if($node->child != null)
{
foreach($node->child as $child)
{
get_nodes2($child, $type, &$result);
}
}
}
}
?>