RsD0p9BK
12/13/2017 - 12:33 PM

Get array values from multidimensional array

Get array values from multidimensional array

$arr = array(

  array('a', 'b'),
  array('c', 'd'),
  array('e', 'f'),

);

// You can make it look concise using array_map :)
$arr = array_map(function($x){ return $x[0]; }, $arr);

// $arr = array('a', 'c', 'e');

https://stackoverflow.com/a/9694194/2618535