Return to Snippet

Revision: 24981
at March 17, 2010 09:45 by Znupi


Initial Code
function getYoutubeVideoID($sVideoURL) {
	$sVideoID = preg_replace('%.*(v=|/v/)(.+?)(/|&|\\?).*%', '$2', $sVideoURL);
	return $sVideoID;
}

Initial URL

                                

Initial Description
Parses any kind of YouTube URL and returns the video ID.

Initial Title
YouTube video ID from URL

Initial Tags

                                

Initial Language
PHP