>

loadHTML($post_content); // Find and display the first image in the post content $images = $dom->getElementsByTagName('img'); if ($images->length > 0) { $first_image = $images->item(0); $image_url = $first_image->getAttribute('src'); if (!empty($image_url)) { echo ''; } } ?>