This question already has an answer here:
I have this array:
Array
(
[0] => Array
(
[fName] => Alice
[lName] => Gibson
)
[1] => Array
(
[fName] => Jack
[lName] => Smith
)
[2] => Array
(
[fName] => Bruce
[lName] => Lee
)
)
How to get an array with all fName values for instance:
["Alice","Jack","Bruce"]
What I've tried and worked is:
foreach($myArray as $info){
$newArray[] = $info['fName'];
}
question:
is it possible to use a single function instead of looping?
</div>