$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
前もって感謝します :)