I want to find all images in the html string like in the code below. Why all results are null in this example (except node name which gives 'img')? I want to display the image html string for each image.
$html = '<img src=\'dasdasdasd.jpg\' >';
$dom = new DOMDocument();
$dom->loadHTML($html);
$els = $dom->getElementsByTagName('img');
foreach ( $els as $el ) {
$nodeName = strtolower($el->nodeName);
$nodetext = strtolower($el->textContent);
$nodeval = strtolower($el->nodeValue);
var_dump($nodeName);
var_dump($nodetext);
var_dump($nodeval);
}