I have the following three arrays of objects:
First Array: $array1
Array (
[0] => Array (
[id] => 1
[name] => world
)
)
Second Array: $array2
Array (
[count] => 1
)
Third Array: $array3
Array (
[KM] => 2
)
I want to add the associative elements from $array2 and $array3 into the subarray at $array1[0].
Desired output:
Array (
[0] => Array
(
[id] => 1
[name] => world
[count] => 1
[KM] => 2
)
)
array_merge()not working for some reason?