Getting first image from content in silverstripe <p>I have the following method where it is suppose to get the first image that is displayed from the content.</p> <pre><code>public function FirstImage($content) { $dom = new DOMDocument(); $dom-&gt;loadHTML($content); Debug::dump($content); } </code></pre> <p>The wierd thing is when i do <strong>$dom->loadHTML</strong> I get the following error <code>Empty string supplied as input</code>, but as soon as I dump it I do get the correct data. How can I fix this problem ?</p> <p>I also done $this->owner->Content which has the same thing.</p>