Disable warnings when loading non-well-formed HTML by DomDocument (PHP)
Posted
by Viet
on Stack Overflow
See other posts from Stack Overflow
or by Viet
Published on 2009-07-19T00:09:15Z
Indexed on
2010/05/17
7:00 UTC
Read the original article
Hit count: 258
I need to parse some HTML files, however, they are not well-formed and PHP prints out warnings to. I want to avoid such debugging/warning behavior programatically. Please advise. Thank you!
Code:
// create a DOM document and load the HTML data
$xmlDoc = new DomDocument;
// this dumps out the warnings
$xmlDoc->loadHTML($fetchResult);
© Stack Overflow or respective owner