How to get Youtube Video Id from the URL using PHP?

Given a YouTube Video URL can you find the VID from the URL?.The following Phip snippet helps you to do the same. The key things to keep in mind that VID which is a unique string for any video is 11 characters in length. Also the VID is represented by a v parameter in the URL.