How can I do somethink like this with PHP DOM?
<img src="<?php echo $picsrc; ?>">
This Code
$node->setAttribute('src','<?php echo $picsrc;?>');
does escape the PHP Tag.
<img src="<?php echo $picsrc; ?>">
Is there a way to use
$dom->createProcessingInstruction()
for Attribute Values?
You should try this
$srcPath = '<?php echo $picsrc;?>';
$node->setAttribute('src', html_entity_decode($srcPath));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With