Source Code:
(back to article)
<?php $data = [ [ 'id' => 1, 'name' => 'John', 'age' => 30, ], [ 'id' => 2, 'name' => 'Jane', 'age' => 25, ], [ 'id' => 3, 'name' => 'Jim', 'age' => 35, ], ]; $names = array_column($data, 'name'); print_r($names); ?>
Result:
Report an issue