title: Change all keys in a array
body: <p>I want to replace all index keys in a array but i need to do it only with a function like array_map (not with a foreach) and that's why it's a little hard for me.</p>
  
  <p>Actual array :</p>
  
  <pre><code>$array = [
      'mc_gross' =&gt; 10.17,
      'protection_eligibility' =&gt; 'Eligible',
      'address_status' =&gt; 'unconfirmed',
      'payer_id' =&gt; 'STTAC7UV2CVJ4'
  ];
  </code></pre>
  
  <p>Expected array :</p>
  
  <pre><code>$array = [
      'McGross' =&gt; 10.17,
      'ProtectionEligibility' =&gt; 'Eligible',
      'AddressStatus' =&gt; 'unconfirmed',
      'PayerId' =&gt; 'STTAC7UV2CVJ4'
  ];
  </code></pre>
  
  <p>I have already a function to put the first letter in uppercase and remove all '<em>_</em>' :</p>
  
  <pre><code>str_replace(
      "_",
      "",
      implode(
          '_',
          array_map(
              'ucfirst',
              explode(
                  '_',
                  ucwords(strtolower($key))
              )
          )
      )
  );
  </code></pre>
  
  <p>I have tried with array_walk, but this function can't replace index key, only value... :</p>
  
  <pre><code>array_walk($array, function ($value, &amp;$key) {
      $key = str_replace("_", "", implode('_', array_map('ucfirst', explode('_', ucwords(strtolower($key))))));
  });
  </code></pre>
  
  <p>Thanks in advance for your help.</p>