Reputation: 4768
array_push($array, getData()) gives me:
Array
(
[customer] => One
[itemno] => Yellow Ribbon
)
Array
(
[customer] => One
[itemno] => Blue Band
)
Array
(
[0] => Array
(
[customer] => Two
[itemno] => Red Tape
)
)
But what I want is:
Array
(
[customer] => One
[itemno] => Yellow Ribbon
)
Array
(
[customer] => One
[itemno] => Blue Band
)
Array
(
[customer] => Two
[itemno] => Red Tape
)
What am I supposed to use?
Upvotes: 1
Views: 155
Reputation: 17555
Assuming you're using numeric keys in $array, a simple array_merge($array,getData()) should work, because getData() apparently returns a numeric-indexed multi-dimensional array.
Upvotes: 1