Prueba esto, nunca me fallo:
Código php:
Ver originalfunction youtubeId($url){
$urlsYoutube=array('www.youtube.com','youtube.com'); $urlFinSep=explode('/',$urlSep[1]); if(!in_array($urlFinSep[0],$urlsYoutube))return false; if(count($sep)<=0)return false; for($i=0;$i<count($sub);$i++){ if($subed[0]=='v'){
return $subed[1];
}
}
return false;
}
Edito:
Me confindi

pense no lei vien y pense que buscabas como sacar el id :D