DOMDocument::replaceChildren

Replace children in document

&reftitle.description; public `void` `DOMDocument::replaceChildren` ``DOMNode``string```nodes`

Replaces the children in the document with new `nodes`.

&reftitle.examples;

### `DOMDocument::replaceChildren` example

Replaces the children with new nodes.

    <?php
    $doc = new DOMDocument;
    $doc->loadXML("<container><hello/></container>");

    $doc->replaceWith("beautiful", $doc->createElement("world"));

    echo $doc->saveXML();
    ?>

&example.outputs;

    <?xml version="1.0"?>
    beautiful
    <world/>

&reftitle.seealso;

- `DOMParentNode::replaceChildren`
- `DOMDocument::append`
- `DOMDocument::prepend`