Dave Morgan is correct in that DOM classes are more powerful, but in case you want to stick with SimpleXML, try using the unset() function on any node, and that node will be removed from the XML.
unset($simpleXMLDoc->node1->child1)
More Related Contents:
- Loop dirs and write xml of content files in php [closed]
- How to echo every var more than $var? [closed]
- How to convert array to SimpleXML
- How do you parse and process HTML/XML in PHP?
- How to convert XML into array in PHP?
- Selecting a css class with xpath
- How do you parse and process HTML/XML in PHP?
- Error: “Input is not proper UTF-8, indicate encoding !” using PHP’s simplexml_load_string
- SimpleXML and print_r() – why is this empty?
- How to extract a node attribute from XML using PHP’s DOM Parser
- Is there any way to convert json to xml in PHP?
- How to check if string is a valid XML element name?
- Fix malformed XML in PHP before processing using DOMDocument functions
- Accessing @attribute from SimpleXML
- Best way to process large XML in PHP [duplicate]
- Is htmlentities() sufficient for creating xml-safe values?
- Updating XML node with PHP
- What is the fastest XML parser in PHP?
- How to skip invalid characters in XML file using PHP
- PHP – Processing Invalid XML
- XML Parse Error – Extra content at the end of the document
- Using SimpleXML to create an XML object from scratch
- How to setup a cron job in Magento module?
- converting SOAP XML response to a PHP object or array
- PHP Object as XML Document
- Saving file using curl and PHP
- How to import XML string in a php DOMDocument
- PHP XML inserting element after (or before) another element
- Sending XML data using HTTP POST with PHP
- How to get values inside using php DOM?