Re: unshift a key value pair
| From: | Marc Logghe | Date: | Wed, 09 Jan 2002 11:58:33 +0000 |
| Subject: | Re: unshift a key value pair | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79897@lists.php.net to get a copy of this message | ||
Yes, of course, but the thing is that the order was important. I wanted to
put in a new value/pair at the *start* of my array, so I thougth using
array_unshift(), but that did not work or at leas I did not find how.
With the $arr[$key]=$val assignment you add at the *end* of your array $arr.
Thanks for your fast response
Marc
"Cc Zona" <email@cczona.com> wrote in message
news:email-1BE178.03542109012002@pb1.pair.com...
> In article <20020109085734.5575.qmail@pb1.pair.com>,
> marc.nospam.logghe@devgen.com (Marc Logghe) wrote:
>
> > So it is really easy to *remove* a key-value pair, but how do you put
one in ?
>
> $arr[$key]=$val;
>
> --
> CC