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


Updated May 8, 2016 ● 5,700 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


This website uses cookies. By continuing to use this site, you are accepting our Privacy Policy and Terms of Service.