相关疑难解决方法(0)

使用php修复html文档上错误显示的编码

有没有办法通过phpquery :: newDocument运行这个html标记后修复显示不正确的字符?在使用phpquery创建新文档后,原始文档中的-Classics和现代Woman之间会出现双引号.

    //Original document is UTF-8 encoded
$raw_html = '<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body><p>Mr. Smith of Bangkok celebrated the “Classics with modern Woman”.</p></body></html>';
print($raw_html);

$aNew_document = phpQuery::newDocument($raw_html);
print($aNew_document);
Run Code Online (Sandbox Code Playgroud)

原始输出:曼谷史密斯先生庆祝"与现代女性的经典".

新文件输出:曼谷史密斯先生与现代女性一起庆祝"经典".

php encoding phpquery

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

encoding ×1

php ×1

phpquery ×1