I've got these two php arrays I want to merge, one is a multi dimensional array and the needle is a normal single dimensional array :
Array containing ALL possible locations:
Array
(
[Bedfordview] => 0
[Killarney] => 0
[Melrose] => 0
[Midrand] => 0
[Morningside] => 0
)
I want to merge it with the follow multidimentional array:
Array
(
[11] =>
[12] => Array
(
[Bedfordview] => 7
[Melrose] => 2
[Midrand] => 87
[Morningside] => 4
)
[13] => Array
(
[Morningside] => 8
[Killarney] => 1
)
)
I Need the end result to look like this:
Array
(
[11] => Array
(
[Bedfordview] => 0 ==FROM FIRST ARRAY
[Killarney] => 0 ==FROM FIRST ARRAY
[Melrose] => 0 ==FROM FIRST ARRAY
[Midrand] => 0 ==FROM FIRST ARRAY
[Morningside] => 0 ==FROM FIRST ARRAY
)
[12] => Array
(
[Bedfordview] => 7
[Melrose] => 2
[Midrand] => 87
[Morningside] => 4
[Killarney] => 0 ==FROM FIRST ARRAY
)
[13] => Array
(
[Bedfordview] => 0 ==FROM FIRST ARRAY
[Melrose] => 0 ==FROM FIRST ARRAY
[Midrand] => 0 ==FROM FIRST ARRAY
[Morningside] => 8
[Killarney] => 1
)
)
Any ideas?