Simple PHP Regex to get Vimeo Video ID from URL easily, all vimeo links support, vimeo shortlink, vimeo link with channel name, very easy, just 2 lines of code.
How To Get Vimeo Video ID From URL
Very easy, using preg_replace() function, we will get vimeo video id, all vimeo links support, vimeo shortlink and vimeo link with channel name.
Get Video ID
Use this code:
$video = "https://vimeo.com/channels/staffpicks/157287763"; echo preg_replace("/[^\/]+[^0-9]|(\/)/", "", rtrim($video, "/")); // Regex By Qassim Hassan