I am making a YouTube tool, but I can't understand how to get the video ID in a PHP variable. Suppose a user type a youtube video url in my form which can be:
http://www.youtube.com/watch?v=YzOt12co4nk&feature=g-vrec
What is the way to filter the URL and get this video ID in a variable?
For example: $vid
will have this video ID so it would be $vid = YzOt12co4nk;
Please take a time to describe it, I'm a beginner in coding! Thanks