public static function get_vimeo_id($input)
    {
        // match: https://vimeo.com/39502360
        if (preg_match('#/vimeo.com/(\d+)#', $input, $matches)) {
            return $matches[1];
        }

        // match: <iframe src="https://player.vimeo.com/video/39502360" width="640" height="480" frameborder="0" ...
        if (preg_match('#/video/(\d+)#', $input, $matches)) {
            return $matches[1];
        }

        return null;
    }
public static function get_vimeo_id($input)
    {
        // match: https://vimeo.com/39502360
        if (preg_match('#/vimeo.com/(\d+)#', $input, $matches)) {
            return $matches[1];
        }

        // match: <iframe src="https://player.vimeo.com/video/39502360" width="640" height="480" frameborder="0" ...
        if (preg_match('#/video/(\d+)#', $input, $matches)) {
            return $matches[1];
        }

        return null;
    }
public static function get_vimeo_id ( $ input ) { // match: https://vimeo.com/39502360 if ( preg_match ( '#/vimeo.com/(\d+)#' , $ input , $ matches ) ) { return $ matches [ 1 ] ; } // match: <iframe src="https://player.vimeo.com/video/39502360" width="640" height="480" frameborder="0" ... if ( preg_match ( '#/video/(\d+)#' , $ input , $ matches ) ) { return $ matches [ 1 ] ; } return null ; }
Parses various vimeo urls and returns video identifier.

@param string $input The url or the embed code
@return string The url's id
Parses various vimeo urls and returns video identifier .