📜  未定义的数组键 php 代码示例

📅  最后修改于: 2022-03-11 14:54:20.830000             🧑  作者: Mango

代码示例4
 'apple',
    'fruit2' => 'orange',
    'fruit3' => 'grape',
    'fruit4' => 'apple',
    'fruit5' => 'apple');

// this cycle echoes all associative array
// key where value equals "apple"
while ($fruit_name = current($array)) {
    if ($fruit_name == 'apple') {
        echo key($array).'
'; } next($array); } ?>