Php
<?php $url = 'http://vimeo.com/25451551'; /* http://www.vimeo.com/25451551 ... www.vimeo.com/25451551 */ $url = preg_match('???', $url); echo $url; ?>
Exit
25451551
Any help with this would be greatly appreciated. Thanks.
If video IDs can start with 0, you may need to tweak the following code a bit:
$url = 'http://vimeo.com/25451551'; sscanf(parse_url($url, PHP_URL_PATH), '/%d', $video_id); // $video_id = int(25451551)
$url = 'http://vimeo.com/25451551/test'; $result = preg_match('/(\d+)/', $url, $matches); if ($result) { var_dump($matches[0]); }