Home >Web Front-end >HTML Tutorial >解决phpQuery(DOMDocument)解析部分HTML会产生乱码的问题_html/css_WEB-ITnose

解决phpQuery(DOMDocument)解析部分HTML会产生乱码的问题_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:16:281035browse

可能是由于头部一些空白非法字符或者无法正常解析其他原因导致不能正常识别解析

解决办法:

在载入文当前拼凑 

DOM:$dom = new DOMDocument(); $dom->loadHTML('<meta charset="html编码">'.$html);phpQuery:phpQuery::newDocument('<meta charset="html编码">'.$html)



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn