我想解析一個html文件。Domdocument loading
$html =htmlentities(file_get_contents('http://forums.heroesofnewerth.com/showthread.php?553261'));
$dom = new DOMDocument();
$dom->loadHTML($html);//line 30
我得到這些錯誤
Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in Entity, line: 113 in D:\Projects\Web projects\done\honscript\index.php on line 30
Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in Entity, line: 113 in D:\Projects\Web projects\done\honscript\index.php on line 30
Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in Entity, line: 200 in D:\Projects\Web projects\done\honscript\index.php on line 30
Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in Entity, line: 200 in D:\Projects\Web projects\done\honscript\index.php on line 30
改爲使用htmlenttities並獲得
Warning: DOMDocument::loadHTML(): Empty string supplied as input in D:\Projects\Web projects\done\honscript\index.php on line 30
index.php中的第30行是什麼? – Fuzzyma
'new DOMDocument();' –
$ dom-> loadHTML($ html);是行30 –