<?php $string = "<tag>i don't know what is here</tag>"; $replacement = "replacement"; $doc = new DOMDocument(); $doc->loadXML($string); $node = $doc->getElementsByTagName('tag')->item(0); $newNode = $doc->createElement("tag", $replacement); $node->parentNode->replaceChild($newNode, $node); echo $doc->saveHTML();
You have javascript disabled. You will not be able to edit any code.