DOMElement::remove
Removes the element
Description
public void DOMElement::remove()
Parameters
This function has no parameters.
Return Values
No value is returned.
Examples
Example #1 DOMElement::remove example
<?php
$doc = new DOMDocument;
$doc->loadXML("<container><hello/><world/></container>");
$hello = $doc->documentElement->firstChild;
$hello->remove();
echo $doc->saveXML();
?>
The above example will output:
<?xml version="1.0"?>
<container><world/></container>
See Also
- DOMElement::after
- DOMElement::before
- DOMElement::replaceWith
- DOMNode::removeChild