Combine arrays into multidimensional arrays.
Posted: Sat Mar 14, 2009 11:32 am
So I have three arrays:
I want to combine them into an array that looks like this:
Is there a specific function to do this and use the first array (names) as the index?
Code: Select all
Names Array
(
[0] => Bob
[1] => Joe
[2] => Foo
)
Age Array
(
[0] => 20
[1] => 30
[2] => 15
)
Another Array
(
[0] => 105
[1] => 87
[2] => 35
)
Code: Select all
Combined Array
(
[Bob] => array (
[Age] => 20
[Another] => 105
)
[Joe] => array (
[Age] => 30
[Another] => 87
)
[Foo] => array (
[Age] => 15
[Another] => 35
)
)