DOMDocument->saveHTMLFile saving escaped text
-
20-09-2019 - |
Question
I am trying to save a string of html into the nodeValue attribute of a DOMElement in PHP, but after I save the file with DOMDocument->saveHTMLFile the string of HTML is escaped and I can not figure out how to get the string not be saved as escaped text. Any ideas?
Solution
You should load that string of html with DOMDocument::loadHTML and append that to your node (appendChild).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow