As per my comment what you need is html_entity_decode.
$innerHTML .= html_entity_decode($tmp_doc->saveHTML());
DEMO.
Frage
I get the inner html for Persian web page with this method :
private static function getInnerHTML($node)
{
$innerHTML = "";
$children = $node->childNodes;
foreach ($children as $child) {
$tmp_doc = new DOMDocument();
$tmp_doc->appendChild($tmp_doc->importNode($child,true));
$innerHTML .= $tmp_doc->saveHTML();
}
return $innerHTML;
}
When I see the source in browser, I found the Persian characters as below :
گزارش
What can I do to convert this coding to regular Persian characters?
For example this chars must be :
گزارش
Sorry, I don't know what is this coding, so I can't search for it before.
Thanks.
Lösung
As per my comment what you need is html_entity_decode.
$innerHTML .= html_entity_decode($tmp_doc->saveHTML());
DEMO.