Answers for "get key of array element php"

PHP
0

get array key php

array_keys ($array);
// It returns an array
// more informations at https://www.php.net/manual/fr/function.array-keys.php (fr)
Posted by: Guest on October-06-2020
1

get key of array element php

$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'));
Posted by: Guest on May-18-2020

Code answers related to "get key of array element php"

Browse Popular Code Answers by Language