php - Extract special characters using DOMDocument -


how parse special characters html domdocument?

for eg, if want fetch paragraph this wikipedia page, i'm able with-

$dom= new domdocument(); $html = file_get_contents("http://en.wikipedia.org/wiki/aditya"); $dom->loadhtml($html); $items=$dom->getelementsbytagname('p'); foreach($items $item){     echo $item->textcontent;     break; } 

but in response get-

Ādityas instead of Ādityas,

à ¤†à ¤¦à ¤¿à ¤¤à ¥Âà ¤¯ instead of आदित्य , on..

basically want know how encode these characters when fetched domelement. later i'll saving them in database or plain text only.


Comments

Popular posts from this blog

rdbms - what exactly the undo information lives in oracle? -

bash - How do you programmatically add a bats test? -

clojure - 'get' replacement that throws exception on not found? -