Lets say I have a youtube video url www.youtube.com/watch?v=B4CRkpBGQzU&feature=youtube_gdata&par1=1&par2=2
www.youtube.com/watch?v=B4CRkpBGQzU&feature=youtube_gdata&par1=1&par2=2
I want to get the video thumbnail ->
Assuming youtube doesn't change their format:
$thumb = preg_match('/watch\?v=(.*)&feature/',$url, $matches);
This will get you the 'B4CRkpBGQzU' part in $matches[1];
$matches[1];