Wednesday, 15 June 2011

domdocument - PHP Misplace DocType warning -



domdocument - PHP Misplace DocType warning -

i getting error php domdocument in run time saying

error: "domdocument::loadhtml() [<a href='domdocument.loadhtml'>domdocument.loadhtml</a>]: misplaced doctype declaration in entity, domdocument::loadhtml() line: 1 domdocument::loadhtml() [<a href='domdocument.loadhtml'>domdocument.loadhtml</a>]: htmlparsestarttag: misplaced &lt;html&gt; tag in entity, line2:

my codes

$doc = new domdocument(); @$doc->loadhtml($htmlstring);

my html string varies.

i not sure how solve issue. can suggest solution? much!

well, should create every effort seek ensure proper markup. however, can suppress these errors with:

libxml_use_internal_errors(false);

which not trigger errors due malformed html (but can still access them using libxml_get_errors if want see issues encountered during parsing.

php domdocument

No comments:

Post a Comment