I want to use the dom removeChild function in php to remove everything between a tag.
my xml looks like
text
$dom = new DOMDocument;
$dom->loadXML($xml);
$dom->getElementsByTagName('root')->item(0)
->removeChild($dom->getElementsByTagName('remove')->item(0));
This is very specific, though. You can use XPath if you need more generality:
foreach ($xpath->query('//remove') as $node) {
$node->parentNode->removeChild($node);
}
You can use XPath and delete over XPath the node.
Use DOM and XPath to remove a node from a sitemap file
PHP SimpleXML - Remove xpath node
here on Stackoverflow are a lot of posts. Perhaps you should search here at first.