如何从URL获取视频ID? (DailyMotion) [英] How do I get the Video Id from the URL? (DailyMotion)
本文介绍了如何从URL获取视频ID? (DailyMotion)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
示例:
http://www.dailymotion.com/video/x4xvnz_the-funny-crash-compilation_fun
如何获取x4xvnz
?
推荐答案
您可以使用 basename
[docs] 来获取URL的最后一部分,然后
You can use basename
[docs] to get the last part of the URL and then strtok
[docs] to get the ID (all characters up to the first _
):
$id = strtok(basename($url), '_');
这篇关于如何从URL获取视频ID? (DailyMotion)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文