📜  获取数组元素的键 php代码示例

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

代码示例1
$people = array(
  2 => array(
    'name' => 'John',
    'fav_color' => 'green'
  ),
  5=> array(
    'name' => 'Samuel',
    'fav_color' => 'blue'
  ));
$found_key = array_search('blue', array_column($people, 'fav_color'));