public static function url_parser($url)
    {
        $regex = '/(?<=v=|v\/|vi=|vi\/|youtu.be\/|embed\/)([a-zA-Z0-9_-]{11})/';

        if (!empty($url)) {
            //full youtube URL
            if (strpos($url, 'youtu') !== false) {
                if (preg_match($regex, $url, $matches)) {
                    return $matches[1];
                }
            } elseif (strlen($url) == 11) {
                return $url;
            }
        }

        return false;
    }