Posted by David Smithz on 01/30/07 10:44
> Smithz asked:
>
>>if there is a key with value "key2", change this key name so it is instead
>>"key number 2" (while maintaining the keys value).
>Geoff said:
> $array['key number 2']=$array['key2'];
> //optionally
> unset($array['key2']);
Thanks for this Geoff. Works. However does lose the ordering of my array. Is
there a way of maintaining the order as I guess the above puts in a new
element, and then just removes the old one.
How can I as well maintain the order.
thanks
[Back to original message]
|