I have an array as follows:
$arr1 = array(
0 => array(
'name' => 'tom',
'age' => 22
),
1 => array(
'name' => 'nick',
'age' => 18
)
);
However I want to create an array from it which consists of all the names, so it would become:
$arr2 = array('tom', 'nick');
I have looked at array_filter(), but that would not work as this is a multi-dimensional array!
Question
How can I create an array with the values of a specific key (name) from another multi-dimensional array?