$dom= new DOMDocument('1.0', 'iso-8859-1');
$dom->loadHTML(' <html><body> <strong>SECOND</strong> </body></html>');
$path = new DOMXPath($dom);
foreach($path->query('body') as $found){
$found->nodeValue = ' <strong>FIRST</strong> '.$found->nodeValue;
}
var_dump($dom->saveHTML()); //It shows <strong> as "<strong>"
The "strong" tags in this example will be transformed in text. Actually I need to add a big HTML code there. And its not well formated, somethings will be fixed later.
How can I do this?