📜  php 从数组中获取键和值 - PHP 代码示例

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

代码示例2
foreach($yourArray as $key => $value) {
    echo '' . $key . '';
}

// OR

//Use functions
key($array);     //Returns current key
reset($array);   //Moves array pointer to first record
current($array); //Returns current value
next($array);    //Moves array pointer to next record and returns its value
prev($array);    //Moves array pointer to previous record and returns its value
end($array);     //Moves array pointer to last record and returns its value