$arr
= array(
'fruit1' => 'apple' ,
'fruit2' => 'orange' ,
'fruit3' => 'grape' ,
'fruit4' => 'apple' ,
'fruit1' => 'apple' ,
'fruit2' => 'orange' ,
'fruit3' => 'grape' ,
'fruit4' => 'apple' ,
);
end($arr);
echo key($arr);
);
end($arr);
echo key($arr);