Page 1 of 1

array problem

Posted: Sat Oct 31, 2009 7:13 am
by itsmani1

Code: Select all

 
    $arr[] = array("foo" => "bar", 12 => true);
    
    $arr[] = array("fo" => "ba");
 
this code has following output:

Code: Select all

Array
(
    [0] => Array
        (
            [foo] => bar
            [12] => 1
        )
 
    [1] => Array
        (
            [fo] => ba
        )
 
)
I wanted output like this:

Code: Select all

Array
(
    [0] => Array
        (
            [foo] => bar
            [12] => 1
            [fo] => ba
        )
 
)

Re: array problem

Posted: Sat Oct 31, 2009 8:08 am
by acaibdu
I have the same problem. Thanks for sharing.

Re: array problem

Posted: Sat Oct 31, 2009 8:14 am
by Mark Baker
$arr[0] = array("foo" => "bar", 12 => true);
$arr[0] = array("fo" => "ba");