I'd think $arr['8'] = 6 would work...

Using a number (as in $arr[8] = 6) would possibly confuse things, though
I can't get to a PHP machine right now so I'm not sure.

M

On Fri, 8 Mar 2002, Bradley Goldsmith wrote:

> Hi,
>
>       Ive got an array of associations like this:
>
>       [1]=>2 [2]=>3 [3]=>4 etc
>
>       I want to add a new element [8]=>6.
>
>       How do I do this? I have tried several ways: pushing the element,
> merging arrays, etc with no luck (it either increments the key or doesn't
> work at all).
>
>       Any ideas would be appreciated!
>
> Cheers,
> Brad
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to