Hello everyone
Recently encountered a need
Enter the URL then output thumbnail youtube
Internet looking for a bit
And tidy
Obtained in the following manner

http://img.youtube.com/vi/NtWnaD6pnpU/0.jpg  // 480 * 360 films to enlarge
http://img.youtube.com/vi/{youtubeID}/1.jpg // 120 * 90 movie starts a little bit
http://img.youtube.com/vi/{youtubeID}/2.jpg // 120 * 90   Videos intermediate
http://img.youtube.com/vi/{youtubeID}/3.jpg // 120 * 90 end of the film
http://img.youtube.com/vi/{youtubeID}/default.jpg // 120 * 90 movie Big Picture
http://img.youtube.com/vi/{youtubeID}/hqdefault.jpg // 480 * 360 films to enlarge equal 0.jpg
http://img.youtube.com/vi/{youtubeID}/mqdefault.jpg // 320 * 180 films to the black side of the big picture
http://img.youtube.com/vi/{youtubeID}/sddefault.jpg // 640 * 480 films to enlarge
http://img.youtube.com/vi/{youtubeID}/maxresdefault.jpg // 1280 * 720 video big picture (should be the highest-resolution large image)


 

How can I get that ID it?
Is the URL parameter [V]
For example: https://www.youtube.com/watch?v=0TsmU0-_q2s
Is 0TsmU0-_q2s

Then I sorted out the way PHP programs

preg_match ('/ watch \ v = ([^ &] *) /','https://www.youtube.com/watch?v=0TsmU0-_q2s',$match?);
$ match [1]; // youtubeID


 

I hope everyone has to help
Thanksgiving!