Microweber\Providers\MediaManager::get_first_image_from_html PHP Метод

get_first_image_from_html() публичный Метод

public get_first_image_from_html ( $html )
    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;
        }
    }