public function removeChildren()
    {
        // we need to collect child nodes to array
        // because removing nodes from the DOMNodeList on iterating is not working
        $childNodes = [];

        foreach ($this->node->childNodes as $childNode) {
            $childNodes[] = $childNode;
        }

        $removedNodes = [];

        foreach ($childNodes as $childNode) {
            $removedNode = $this->node->removeChild($childNode);

            $removedNodes[] = new Element($removedNode);
        }

        return $removedNodes;
    }
public function removeChildren()
    {
        // we need to collect child nodes to array
        // because removing nodes from the DOMNodeList on iterating is not working
        $childNodes = [];

        foreach ($this->node->childNodes as $childNode) {
            $childNodes[] = $childNode;
        }

        $removedNodes = [];

        foreach ($childNodes as $childNode) {
            $removedNode = $this->node->removeChild($childNode);

            $removedNodes[] = new Element($removedNode);
        }

        return $removedNodes;
    }
public function removeChildren ( ) { // we need to collect child nodes to array // because removing nodes from the DOMNodeList on iterating is not working $ childNodes = [ ] ; foreach ( $ this -> node -> childNodes as $ childNode ) { $ childNodes [ ] = $ childNode ; } $ removedNodes = [ ] ; foreach ( $ childNodes as $ childNode ) { $ removedNode = $ this -> node -> removeChild ( $ childNode ) ; $ removedNodes [ ] = new Element ( $ removedNode ) ; } return $ removedNodes ; }
Removes all child nodes.

@return \DiDom\Element[] the nodes that has been removed
Removes all child nodes .