I create some HTML Templates with php doms functionality, now i like to add some php tags into my template i.e.
$input = $this->dom->createElement(\'in
You need a Processing Instruction
$php = $dom->createProcessingInstruction('php', 'echo $foo->bar;');
Full example:
$dom = new DOMDocument;
$dom->loadXml('Test
');
$dom->getElementsByTagName('body')->item(0)->appendChild(
$dom->createProcessingInstruction('php', 'echo $foo->bar;')
);
$dom->format = TRUE;
echo $dom->saveXML();
Result:
Test
bar;?>