Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

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



Government Jobs Opening


...