Organizational Research By

Surprising Reserch Topic

disable warnings when loading non well formed html by domdocument php


disable warnings when loading non well formed html by domdocument php  using -'php,html,warnings,domdocument'

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);


This:

@$xmlDoc->loadHTML($fetchResult)


can  suppress the warnings but how can I capture those warnings programatically?
    

asked Sep 21, 2015 by yashwantpinge
0 votes
9 views



Related Hot Questions

3 Answers

0 votes
NULL
answered Sep 21, 2015 by maurya
0 votes
NULL
answered Sep 21, 2015 by param.oncemore
0 votes
NULL
answered Sep 21, 2015 by okesh.badhiye

...