add dimensional items in array

0

How can I add items in the array like this:

    array_push($arr, $end[0] => $end[1]);

I did not want to add a new array inside the existing one, but rather to add new items in the style $ key = > $ content

To stay like this:

        [A] => B
        [C] => D

And not like this:

array(
        array ( [A] => B ),
        array ( [C] => D )
)
    
asked by anonymous 25.04.2015 / 16:59

1 answer

1

Well, just do the direct inclusion in array :

$arr['A'] = 'B';
$arr['C'] = 'D';
    
25.04.2015 / 17:22