loadHTML(''.$content); $finder = new DomXPath($dom); $images = $finder->query("//img"); if($images->length>0) { // First image from the list $image = $images->item(0); // Get value from attribute src $imgSrc = $image->getAttribute('src'); // Returns the image src return $imgSrc; } return false; } }