My code looks like this:
if (!empty($foo))
{
$doc = new DOMDocument();
$doc->loadHTML($foo);
$images = $doc->getElementsByTagName('img');
}
And this is happening:
DOMDocument::loadHTML() [<a href='domdocument.loadhtml'>domdocument.loadhtml</a>]: Document is empty in Entity, line: 2