0

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

2
Contributors
2
Replies
21
Views
3 Years
Discussion Span
Last Post by Dani
1

$foo is an empty string or has invalid markup.

See the second comment (by Shane Harter) here.

Edited by pritaeas

0

Odd because $foo just finished getting passed through HTML Purifier.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.