本文共 516 字,大约阅读时间需要 1 分钟。
$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的链接:
From:
本文转自ZH奶酪博客园博客,原文链接:http://www.cnblogs.com/CheeseZH/p/4858274.html,如需转载请自行联系原作者