开发者

How to split youtube video ID?

src="http://www.youtube.com/v/R5zKIOTvfwQ?version=3"

and

 src="http://www.开发者_开发问答youtube.com/v/R5zKIOTvfwQ"

How can I get the video ID alone from this src?

Is there any predefined option available for that?


The video ID is the string which is after the v/ and before the ? In your case R5zKIOTvfwQ. If you are looking for an automatic way to retrieve it, try this regex:

/v\/(.*)[\?$]/
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜