function gaunam($URL) {
$simboliu = 11;
$rezas = strpos($URL, "?v=");
if($rezas === FALSE)
$rezas = strpos($URL, "&v=");
$rezas +=3;
$ID = substr($URL, $rezas, $simboliu);
return $ID;
}
while ($row = mysql_fetch_array($result)) {
$url = $row['youtube_nuoroda'];
echo gaunam("$url");
}