Código PHP:
Ver originalfunction YouID($i){
$r='';
foreach($i As $v){if(substr($v,0,2)=='v='){$r=substr($v,2);break;}} }
return $r;}
//uso:
$str='http://www.youtube.com/watch?v=f9IvUS4ipZk';
echo YouID($str);//regresa: f9IvUS4ipZk
echo YouID('http://www.youtube.com/watch?v=JwbVOcysUaQ&feature=player_embedded');//regresa: JwbVOcysUaQ