public function get_first_image_from_html($html) { if (preg_match('/<img.+?src="(.+?)"/', $html, $matches)) { return $matches[1]; } elseif (preg_match('/<img.+?src=\'(.+?)\'/', $html, $matches)) { return $matches[1]; } else { return false; } }