Given the following array
array(
0 => array(
'id' => '54'),
1 => array(
'id' => '11'),
2 => array(
'id' => '2')
);
Is there a (preferrably built-in) function that re-arranges it to
array(
0 => '54',
1 => '11',
2 => '2'
);
in PHP?
My current way is to iterate over the array and save it to another one, which seems awfully redundant, slow, and inefficient.
$newArray = array();
foreach ($oldArray as $innerArray {
$newArray[] = $innerArray['id'];
}
How about using
array_walk