function getchildnodes($child) { dump_html_tree($child); /*foreach ($child[0]->children() as $t) { echo "->".$t->tag."\n"; getchildnodes($t); }*/ }
function dump_html_tree($node, $show_attr=true, $deep=0) { $lead = str_repeat(' ', $deep); echo $lead.$node->tag; if ($show_attr && count($node->attr)>0) { echo '('; foreach($node->attr as $k=>$v) echo "[$k]=>\"".$node->$k.'", '; echo ')'; } echo "\n"; foreach($node->nodes as $c) dump_html_tree($c, $show_attr, $deep+1); }
function dump($show_attr = true) { dump_html_tree($this, $show_attr); }
function dump($show_attr = true) { ///TODO Fix Debug function dump_html_tree($this, $show_attr); }