- print_r: documentation ( source)
- key: documentation ( source)
<?php
$array = array(
'fruit1' => 'apple',
'fruit2' => 'orange',
'fruit3' => 'grape',
'fruit4' => 'apple',
'fruit5' => 'apple');
foreach($array as $value)
{
$mykey = key($array);
print_r($mykey);
}