Rename array key without scrambling order
<p>In PHP, I can easily rename an associative array's key by doing the following.</p>

<pre><code>$array = array(
    "tom" =&gt; "25",
    "bob" =&gt; "36",
);

$array["charlie"] = $array["tom"];
unset($array["tom"]);
</code></pre>

<p>However, this scrambles the order of the array. "bob" becomes the first element and "charlie" (which was "tom") is now the second element.</p>

<pre><code>echo reset($array); // outputs 36 instead of 25
</code></pre>

<p>Is there a way to rename an array key without scrambling its order?</p>

<p>NOTE: I realize I can reconstruct the array, but that is really ugly. I would much rather avoid that.</p>
