|
Posted by Kenneth Downs on 01/20/07 19:04
Pierre L. wrote:
> On Jan 19, 7:04 pm, Ken Loomis <not_a_real_em...@address.com> wrote:
>
>> How can I append a new key-value pair to an associative array?
>
> Just add it:
> $foo = array( 'foo' => 'bar');
> $foo['newkey'] = 'newvalue';
>
> --
> Pierre
Also really cool when you are just adding items to an array w/out keys:
$myarray=array('item1','item2');
$myarray[] = 'item3';
$myarray[] = 'item4';
--
Kenneth Downs
Secure Data Software, Inc.
(Ken)nneth@(Sec)ure(Dat)a(.com)
Navigation:
[Reply to this message]
|