sayı atayın hocam..

$i='';
foreach($urunresim as $resim){
$i++;
if ($i==1){ echo "ilk";}
if ($i==count($urunresim)){ echo "son"; }
echo $resim;
}