codice:
$i = 0;
foreach ($ar as $val)
{
   if ($i < 10) { 
   echo("Id = ".$val."
");
   $i++;
   }
}