📅  最后修改于: 2022-03-11 14:53:50.846000             🧑  作者: Mango
'apple',
'fruit2' => 'orange',
'fruit3' => 'grape',
'fruit4' => 'apple',
'fruit5' => 'apple');
// this cycle echoes all associative array
// key where value equals "apple"
for($i = 0; $i< sizeof($array);$i++){
if (key($array[$i]) == 'apple') {
echo key($array).'
';
}
//next($array);
}
?>