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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-21 09:16:28
Original
1108 people have browsed it

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

解决办法:

在载入文当前拼凑 

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



Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template