I have this code:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
$strXml = '
<root>
<kid><div>ABC•></div></kid>
<kid2>DEF</kid2>
</root>';
$objXml = new SimpleXMLElement($strXml);
$arrNodes = $objXml->xpath('/root/*');
foreach($arrNodes as $objNode) {
/* @var $objNode SimpleXMLElement */
echo $objNode->asXML();
}
The code extracts the first children of the root and displays the content. The problem is the html entities are converted to characters. Is there any way the code output the initial XML content without any conversion ?
Is there any way the code output the initial XML content without any conversion ?
No.
Aside: Why do you care? They're the same character.
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