首页 > Web开发 > 详细

PHP Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in Entity,

时间:2015-10-07 10:47:57      阅读:360      评论:0      收藏:0      [点我收藏+]
$html = file_get_contents("http://www.somesite.com/");

$dom = new DOMDocument();
$dom->loadHTML($html);

echo $dom;

THROWS

Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ‘;‘ in Entity,
Catchable fatal error: Object of class DOMDocument could not be converted to string in test.php on line 10

(1) calling htmlentities() or similar on the string will fix the problem.

(2)To evaporate the warning, you can use libxml_use_internal_errors(true)

From: http://stackoverflow.com/questions/1685277/warning-domdocumentloadhtml-htmlparseentityref-expecting-in-entity

PHP Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in Entity,

原文:http://www.cnblogs.com/CheeseZH/p/4858274.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!