public static function getYoutubeId($url)
    {
        $videoId = false;
        if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $url, $match)) {
            $videoId = $match[1];
        }

        return $videoId;
    }
public static function getYoutubeId($url)
    {
        $videoId = false;
        if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $url, $match)) {
            $videoId = $match[1];
        }

        return $videoId;
    }
public static function getYoutubeId ( $ url ) { $ videoId = false ; if ( preg_match ( '%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i' , $ url , $ match ) ) { $ videoId = $ match [ 1 ] ; } return $ videoId ; }
Extracts the vimeo id from a vimeo url.
Returns false if the url is not recognized as a vimeo url.
Extracts the vimeo id from a vimeo url . Returns false if the url is not recognized as a vimeo url .