Mega Code Archive
Use the createTextNode() method to add multiple text strings to a body element in an HTML document
createElement("html");
$body = $root->createElement("body");
$txt = $root->createTextNode(utf8_encode("Danish characters ?\n"));
$body->appendChild($txt);
$txt = $root->createTextNode(utf8_encode("&"));
$body->appendChild($txt);
$html->appendChild($body);
$root->appendChild($html);
echo $root->saveHTML();
?>