1

I need to get just the Video Id from any keeks video link

Examples of Links from keeks.com

https://www.keek.com/syahrin/keeks/QC06cab
https://www.keek.com/!QC06cab
https://www.keek.com/syahrin#QC06cab
https://www.keek.com/embed/QC06cab

I need the output just QC06cab

4

1 回答 1

1

您可以使用排除分隔符并将模式锚定到字符串末尾的字符类:

if (preg_match('~[^/!#]++$~', $url, $match))
    print_r($match);
于 2013-06-26T18:50:56.790 回答