simple_html_dom_node::dump PHP Method

dump() public method

dump node's tree
public dump ( $show_attr = true, $deep )
    function dump($show_attr = true, $deep = 0)
    {
        $lead = str_repeat('    ', $deep);
        echo $lead . $this->tag;
        if ($show_attr && count($this->attr) > 0) {
            echo '(';
            foreach ($this->attr as $k => $v) {
                echo "[{$k}]=>\"" . $this->{$k} . '", ';
            }
            echo ')';
        }
        echo "\n";
        foreach ($this->nodes as $c) {
            $c->dump($show_attr, $deep + 1);
        }
    }

Usage Example

 function dump($show_attr = true)
 {
     $this->root->dump($show_attr);
 }