is a way to get first value of image src without foreach?
$doc->loadHTML($description);
foreach ($doc->getElementsByTagName('img') as $image) {
echo $image->getAttribute('src');
}
this is not working $doc->getElementsByTagName('img')->item(0)->nodeValue);
This should work: