I would like to append some text to a dom element as a child node.
The problem is that in the text I can have tags as <i>, <bold> etc.
Actually, with this method:
private function appendChildNode($dom_output, $cit_node, $nodeName, $nodeText)
{
if ($nodeText != null && $nodeText != "" ) {
$node = $dom_output->createElement($nodeName);
$node->appendChild($dom_output->createTextNode($nodeText));
$cit_node->appendChild($node);
return $node;
}
}
When I have tags in the $nodeText, then the <i> will be converted to <i> and so on.
How can I append this text by keeping the tags as they are?
Thank you.