2
我有这样的代码:删除DOM警告PHP
$strhtml = file_get_contents('05001400300320100033100.html');
$dochtml = new DOMDocument();
$dochtml->loadHTML($strhtml);
$elm = $dochtml->getElementById('upPanelActuciones');
print $dochtml->saveXml($elm);
即时得到这样的警告:
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: error parsing attribute name in Entity, line: 674 in C:\AppServ\www\video01\sector2\dom3.php on line 10
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Opening and ending tag mismatch: div and td in Entity, line: 1019 in C:\AppServ\www\video01\sector2\dom3.php on line 10
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Opening and ending tag mismatch: div and td in Entity, line: 1020 in C:\AppServ\www\video01\sector2\dom3.php on line 10
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Opening and ending tag mismatch: div and td in Entity, line: 1022 in C:\AppServ\www\video01\sector2\dom3.php on line 10
我不能处理HTML(我知道的HTML文件有错误),所以有是删除此警告的一种方法? (没有出现)。
在此先感谢您的帮助。