简体   繁体   中英

How to parse chinese character using PHP Simple HTML DOM parser?

I am trying to parse a chinese website using Simple HTML DOM ( http://simplehtmldom.sourceforge.net ) but facing problem where all the chinese characters parsed became unrecognized symbols.

Example: "星洲網" became "星洲網"

How to use Simple HTML DOM to parse UTF-8 character? or anything I did wrong in my coding?

Below is my PHP coding:

<?php
require_once ("simple_html_dom.php");

$html = file_get_html("http://www.sinchew-i.com");
print $html->plaintext;
?>
header('Content-Type: text/html; charset=utf-8');

检查此处理unicode

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM