pQuery\DomNode::deleteChild PHP Метод

deleteChild() публичный Метод

Delete a child node
public deleteChild ( integer | DomNode $child, boolean $soft_delete = false )
$child integer | DomNode Child(index) to delete, negative to count from end
$soft_delete boolean False to call {@link delete()} from child
    function deleteChild($child, $soft_delete = false)
    {
        if (is_object($child)) {
            $child = $this->findChild($child);
        } elseif ($child < 0) {
            $child += count($this->children);
        }
        if (!$soft_delete) {
            $this->children[$child]->delete();
        }
        unset($this->children[$child]);
        //Rebuild indices
        $tmp = array();
        //foreach($this->children as &$c) {
        //	$tmp[] =& $c;
        //}
        foreach (array_keys($this->children) as $k) {
            $tmp[] =& $this->children[$k];
        }
        $this->children = $tmp;
    }
DomNode