note 84532 modified in simplexmlelement.addchild by danbrown
| From: | danbrown@php.net | Date: | Fri, 25 Sep 2009 17:16:26 +0000 |
| Subject: | note 84532 modified in simplexmlelement.addchild by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-161073@lists.php.net to get a copy of this message | ||
Easy and fast deleting of a node:
<?php
$oNode = dom_import_simplexml($oSimpleXMLNodeToDelete);
$oNode->parentNode->removeChild($oNode);
?>
The node can have childs, attributes, and be anywhere in your document, it'll get deleted. The
deletion will appear immediately in your SimpleXML object after calling removeChild, there's
nothing else to do.
--was--
Easy and fast deleting of a node:
<?php
$oNode = dom_import_simplexml($oSimpleXMLNodeToDelete);
$oNode->parentNode->removeChild($oNode);
?>
The node can have childs, attributes, and be anywhere in your document, it'll get deleted. The
deletion will appear immediately in your SimpleXML object after calling removeChild, there's
nothing else to do.
http://php.net/manual/en/simplexmlelement.addchild.php