Christoph Jeschke: Array weiteren Key anfügen...

Beitrag lesen

Guten Tag,

Weiß das jemand?

<?php  
  
$a['level_1']['level_2'] = array('foo' => 'bar', 'bar' => 'foo');  
  
print_r($a);  
  
$a['level_1']['level_2']['qux'] = 'baz';  
$a['level_1']['level_2']['baz'] = 'qux';  
  
print_r($a);  
  
?>

Ergibt:

Array  
(  
    [level_1] => Array  
        (  
            [level_2] => Array  
                (  
                    [foo] => bar  
                    [bar] => foo  
                )  
  
        )  
  
)  
Array  
(  
    [level_1] => Array  
        (  
            [level_2] => Array  
                (  
                    [foo] => bar  
                    [bar] => foo  
                    [qux] => baz  
                    [baz] => qux  
                )  
  
        )  
  
)  

Gruß
Christoph Jeschke

--

Zend Certified Engineer
Certified Urchin Admin