$array=[
0 => ['id' => 1,'name' => 'janusz'],
1 => ['id' => 2,'name' => 'pioter'],
];
var_dump(array_column($array, 'name'));
//array(2) { [0]=> string(6) "janusz" [1]=> string(6) "pioter" }
$array=[
0 => ['id' => 1,'name' => 'janusz'],
1 => ['id' => 2,'name' => 'pioter'],
];
var_dump(array_column($array, 'name'));
//array(2) { [0]=> string(6) "janusz" [1]=> string(6) "pioter" }