What is the simpliest way to do merge multiple array values into a single multi-dimension array. For example, I have several arrays ($arr_a, $arr_b) like,
Array
(
[0] => a1
[1] => a2
[2] => a3
)
Array
(
[0] => b1
[1] => b2
[2] => b3
)
The keys array ($keys) for new array like
Array
(
[0] => key1
[1] => key2
[2] => key3
)
I want combine these array to a single array with keys like
Array
(
[0] => Array
(
[key1] => a1
[key2] => a2
[key3] => a3
)
[1] => Array
(
[key1] => b1
[key2] => b2
[key3] => b3
)
)
I tried this this code
$ouput = array_map(null, $arr_a, $arr_b);
But I can't add array keys by this code..