Solution: #PHP DOMDoc-ment::loadHTML(): htmlParseStartTag: invalid element name in Entity


Updated May 8, 2016 ‚óŹ 4,171 views

You might have gotten this error when you are parsing the DOM elements using the the DOM parser:

DOMDocument::loadHTML(): htmlParseStartTag: invalid element name in Entity, line: 1

To resolve this issue, you can supress this warning by adding the below code prior to call to loadHTML().

libxml_use_internal_errors(true);
$dom->loadHTML($content);

 

0 Comments




Our Terms of Use and Privacy Policy have changed.
By continuing to use this site, you are agreeing to the new Privacy Policy and Terms of Use.