$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
提前致谢 :)