Answers for "PHP get array key by value multidimensional"

PHP
1

php multidimensional array get all values by key

$ids = array_column($users, 'id');
Posted by: Guest on May-04-2021
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 "PHP get array key by value multidimensional"

Browse Popular Code Answers by Language