tags:

views:

31

answers:

2

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?

+1  A: 

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.

stillstanding
A: 

This will do what you want...

$array[] = getData(); 
Chris