Using the parameter flag LIBXML_NOWARNING does not stop wanrings when loading html using PHPDOMDocument-> loadHTML. Other constants really work.
In the example below, I add LIBXML_HTML_NODEFDTD to prove that the constants are received (stops adding doctype).
$doc=new DOMDocument(); $doc->loadHTML("<tagthatdoesnotexist><h1>Hi</h1></tagthatdoesnotexist>",LIBXML_NOERROR | LIBXML_NOWARNING | LIBXML_HTML_NODEFDTD); echo $doc->saveHTML();
However, warnings are still generated and displayed. What am I missing?
php libxml2
user2782001 Jan 25 '17 at 6:22 2017-01-25 06:22
source share