I have a somewhat complicated function that builds an array structure dynamically to insert fields into MongoDB. We store the structure in MySQL.
The function outputs the following array structure:
Array
(
[address] => Array
(
[street] => 10 Stack St
)
)
Array
(
[address] => Array
(
[city] => Overflow Mountains
)
)
Array
(
[address] => Array
(
[state] => CM
)
)
Array
(
[address] => Array
(
[zip] => 01010
)
)
I need to merge these arrays so it looks like
[address] => Array
(
[street] => 10 Stack St
[city] => Overflow Mountains
[state] => CM
[zip] => 01010
)
How would I go about doing this? I am using PHP.