DOMParentNode::replaceChildren Replace children in node &reftitle.description; public voidDOMParentNode::replaceChildren DOMNodestringnodes Replace children in node. &reftitle.parameters; nodes The nodes replacing the children. Strings are automatically converted to text nodes. &reftitle.returnvalues; &return.void; &reftitle.errors; &dom.errors.hierarchy.self; &dom.errors.wrong_document; &reftitle.changelog; &Version; &Description; 8.3.0 Calling this method on a node without an owner document now works. &dom.changelog.previous_hierarchy_exception; &reftitle.examples; <methodname>DOMParentNode::replaceChildren</methodname> example loadHTML('

hi

test

hi2

'); $dom->documentElement->replaceChildren('foo', $dom->createElement('p'), 'bar'); echo $dom->saveXML(); ?> ]]>
&example.outputs; foo

bar ]]>