Revision: 44873
Updated Code
at November 6, 2011 02:33 by KabuqueJoe
Updated Code
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Returns the video id for any type of youtube url that holds one, like the links bellow. http://www.youtube.com/watch?v=pkPgYbdQ1kQ&feature=feedu www.youtube.com/watch?v=pkPgYbdQ1kQ&feature=feedu youtube.com/watch?v=pkPgYbdQ1kQ&feature=feedu http://www.youtube.com/v/pkPgYbdQ1kQ&feature=feedu www.youtube.com/v/pkPgYbdQ1kQ&feature=feedu http://youtu.be/pkPgYbdQ1kQ youtu.be/pkPgYbdQ1kQ |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/ function uTubeId($url){ $url = preg_replace('((http://)?(www.)?(youtube.com|youtu.be)(/v/|/watch\?v=|/)([a-zA-Z0-9_-]*)(.*))',"$5",$url); return (preg_match('(([a-zA-Z0-9_-]*){11,18})',$url) ? $url : ''); }
Revision: 44872
Updated Code
at September 20, 2011 08:16 by KabuqueJoe
Updated Code
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Returns the video id for any type os youtube url that holds a video id, like the links bellow http://www.youtube.com/watch?v=pkPgYbdQ1kQ&feature=feedu www.youtube.com/watch?v=pkPgYbdQ1kQ&feature=feedu youtube.com/watch?v=pkPgYbdQ1kQ&feature=feedu http://www.youtube.com/v/pkPgYbdQ1kQ&feature=feedu www.youtube.com/v/pkPgYbdQ1kQ&feature=feedu http://youtu.be/pkPgYbdQ1kQ youtu.be/pkPgYbdQ1kQ |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/ function uTubeId($url){ $url = preg_replace('((http://)?(www.)?(youtube.com|youtu.be)(/v/|/watch\?v=|/)([a-zA-Z0-9_-]*)(.*))',"$5",$url); return (preg_match('(([a-zA-Z0-9_-]*){11,18})',$url) ? $url : ''); }
Revision: 44871
Updated Code
at April 20, 2011 00:49 by KabuqueJoe
Updated Code
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Returns the video id for any type os youtube url that holds a video id, like the links bellow http://www.youtube.com/watch?v=pkPgYbdQ1kQ&feature=feedu www.youtube.com/watch?v=pkPgYbdQ1kQ&feature=feedu youtube.com/watch?v=pkPgYbdQ1kQ&feature=feedu http://www.youtube.com/v/pkPgYbdQ1kQ&feature=feedu www.youtube.com/v/pkPgYbdQ1kQ&feature=feedu http://youtu.be/pkPgYbdQ1kQ youtu.be/pkPgYbdQ1kQ |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/ function uTubeId($url){ return preg_replace('((http://)?(www.)?(youtube.com|youtu.be)(/v/|/watch\?v=|/)([a-zA-Z0-9_-]*)(.*))',"$5",$url); }
Revision: 44870
Updated Code
at April 20, 2011 00:48 by KabuqueJoe
Updated Code
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Returns the video id for any type os youtube url that holds a video id, like the links bellow http://www.youtube.com/watch?v=pkPgYbdQ1kQ&feature=feedu www.youtube.com/watch?v=pkPgYbdQ1kQ&feature=feedu youtube.com/watch?v=pkPgYbdQ1kQ&feature=feedu http://www.youtube.com/v/pkPgYbdQ1kQ&feature=feedu www.youtube.com/v/pkPgYbdQ1kQ&feature=feedu http://youtu.be/pkPgYbdQ1kQ youtu.be/pkPgYbdQ1kQ |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/ function yTubeId($url){ return preg_replace('((http://)?(www.)?(youtube.com|youtu.be)(/v/|/watch\?v=|/)([a-zA-Z0-9_-]*)(.*))',"$5",$url); }
Revision: 44869
Updated Code
at April 20, 2011 00:47 by KabuqueJoe
Updated Code
/*||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Returns the video id for any type os youtube url that holds a video id, like the links bellow http://www.youtube.com/watch?v=pkPgYbdQ1kQ&feature=feedu www.youtube.com/watch?v=pkPgYbdQ1kQ&feature=feedu youtube.com/watch?v=pkPgYbdQ1kQ&feature=feedu http://www.youtube.com/v/pkPgYbdQ1kQ&feature=feedu www.youtube.com/v/pkPgYbdQ1kQ&feature=feedu http://youtu.be/pkPgYbdQ1kQ youtu.be/pkPgYbdQ1kQ |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/ function yTubeId($url){ return preg_replace('((http://)?(www.)?(youtube.com|youtu.be)(/v/|/watch\?v=|/)([a-zA-Z0-9_-]*)(.*))',"$5",$url); }
Revision: 44868
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at April 20, 2011 00:46 by KabuqueJoe
Initial Code
function yTubeId($url){ return preg_replace('((http://)?(www.)?(youtube.com|youtu.be)(/v/|/watch\?v=|/)([a-zA-Z0-9_-]*)(.*))',"$5",$url); }
Initial URL
Initial Description
Returns the video id for any type of youtube url that holds one.
Initial Title
youtube url video id
Initial Tags
regex, url, php, link, video
Initial Language
PHP