$message = "this is an youtube video http://www.youtube.com/watch?v=w6yF_UV1n1o&feature=fvst i want only the id";
$message = preg_replace('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', '\\1', $message);
print $message;
上面印...
this is an youtube video http://www.w6yF_UV1n1o&feature=fvst i want only the id
什么我想要的是:
this is an youtube video w6yF_UV1n1o i want only the id
在此先感谢:)
我并不想只分析一个URL我想解析整个消息,这是一个vBulletin蟒蛇第三,让用户CA只粘贴链接和YouTube视频会奇迹般地出现:) –