PHP DOMDocument does not keep numeric presentation of HTML special characters -
i have domdocument , append nodes.
in 1 of nodes, put:
$copyrightstatementtext = "© copyright";
the problem function:
$copyrightstatement = $dom_output->createelement('copyright-statement', $copyrightstatementtext);
is converting ©
©.
my goal keep ©
any idea how that?
from domdocument::createelement():
note:
value
not escaped. use domdocument::createtextnode() create text node escaping support.
so use domdocument::createtextnode() instead:
$copyrightstring = "© copyright"; $copyrightnode = $dom_output->createtextnode($copyrightstring); $copyrightcontainer = $dom_output->createelement('copyright-statement'); $copyrightcontainer->appendchild($copyrightnode);
Comments
Post a Comment