title: how to change a key in an array while maintaining the order?
body: <p>How i can do this:</p>
  
  <pre><code>$array = array('a' =&gt; 1, 'd' =&gt; 2, 'c' =&gt; 3); //associative array
  
  // rename $array['d'] as $array['b']
  $array = replace_key_function($array, 'd', 'b');
  
  var_export($array); // array('a' =&gt; 1, 'b' =&gt; 2, 'c' =&gt; 3); same order!
  </code></pre>
  
  <p>I didn't see a function that does that.
  There is a way to do this?</p>