fork download
  1. <?php
  2.  
  3. $videoLink = 'https://v...content-available-to-author-only...o.com/11111111
  4. http://v...content-available-to-author-only...o.com/11111111
  5. www.vimeo.com/11111111
  6. vimeo.com/11111111
  7. https://v...content-available-to-author-only...o.com/channels/11111111
  8. http://v...content-available-to-author-only...o.com/channels/11111111
  9. https://v...content-available-to-author-only...o.com/groups/name/videos/11111111
  10. http://v...content-available-to-author-only...o.com/groups/name/videos/11111111
  11. https://v...content-available-to-author-only...o.com/album/2222222/video/11111111
  12. http://v...content-available-to-author-only...o.com/album/2222222/video/11111111
  13. https://v...content-available-to-author-only...o.com/11111111?param=test
  14. http://v...content-available-to-author-only...o.com/11111111?param=test';
  15.  
  16.  
  17. // captures a single url
  18.  
  19. if (preg_match("/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)/uim", $videoLink, $id)) {
  20. $videoId = $id[3];
  21. echo $videoId . "\n";
  22. }
  23.  
  24. // captures all urls
  25.  
  26. $videoId = array();
  27.  
  28. if (preg_match_all("/vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)/uim", $videoLink, $id)) {
  29. $videoId[] = $id[3];
  30. print_r($videoId);
  31. }
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
11111111
Array
(
    [0] => Array
        (
            [0] => 11111111
            [1] => 11111111
            [2] => 11111111
            [3] => 11111111
            [4] => 11111111
            [5] => 11111111
            [6] => 11111111
            [7] => 11111111
            [8] => 11111111
            [9] => 11111111
            [10] => 11111111
            [11] => 11111111
        )

)