I have HTML that needs to be parsed using DOMDocument::loadHtml($html), but it gives me an error:
DOMDocument::loadHTML(): ID 'my id' already defined in Entity
I have no control over it $html, but I can use tidy lib (or something else, ideas?) On it and make parsed HTML. But I do not find the option in a neat configuration to remove the duplicate ID in the confid. My code is as follows:
$tidy = new tidy();
$tidy->parseString($this->getPageContents());
$html = new DOMDocument();
$html->loadHTML($tidy);
thank
Lucas source
share