This question already has an answer here:
I have two array one is two dimensional
and second is one dimensional
and want to merge in a two dimensional array.
For Example :
# array1
Array
(
[0] => Array
(
[id] => 598
)
[1] => Array
(
[id] => 599
)
)
# array2
Array
(
[id] => 66
)
#resultant array
Array
(
[0] => Array
(
[id] => 598
)
[1] => Array
(
[id] => 599
)
[2] => Array
(
[id] => 66
)
)
In above example array1
and array2
are two input array and want to result as resultant array
.
I have tried array_merge
php function but it is not working.
How to do that?
</div>