Re: how to update array keys and keep element order ?
| From: | Al | Date: | Fri, 21 May 2010 13:33:24 +0000 |
| Subject: | Re: how to update array keys and keep element order ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-305391@lists.php.net to get a copy of this message | ||
On 5/21/2010 5:56 AM, cr.vegelin@gmail.com wrote:
How do I update an array key without disturbing the element order ? Suppose an existing array("FR", values ...) where I want to change 0 => "FR" to "country" => "FR" and keep the original element order. TIA, CorI short on time; but, it seems array_combine() or array_fill_keys() would do it for you.