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文件有錯誤),所以有是刪除此警告的一種方法? (沒有出現)。
在此先感謝您的幫助。