3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = Array ( 0 => Array ( 'id' => 1, 'column2' => 'value2', 'column3' => 'value3', 'column4' => 'value4', 'column5' => 'value5' ), 1 => Array ( 'id' => 1, 'column2' => 'value2', 'column3' => 'value3', 'column4' => 'value4', 'column5' => 'value5' ), 2 => Array ( 'id' => 2, 'column2' => 'value2', 'column3' => 'value3', 'column4' => 'value4', 'column5' => 'value5' ), ); $keys = array_keys(array_column($array, 'column2'), value2); //$new_array = array_map(function($k) use ($array){return $array[$k];}, $keys); print_r($keys);
Output for 5.6.30
Notice: Use of undefined constant value2 - assumed 'value2' in /in/OS2hR on line 10 Array ( [0] => 0 [1] => 1 [2] => 2 )