title: Replacing keys of an associative array with values of a different associative array with same keys
body: <p>I have an associative array as given below:</p>
  <pre><code>$baseArray = array(
      'a' =&gt; array('apple', 'mango'),
      'b' =&gt; array('lettuce', 'spinach'),
      'c' =&gt; array('carrots', 'radish'),
      'd' =&gt; array('beans', 'okra'),
      'e' =&gt; array('chicken', 'mutton')
  );
  </code></pre>
  <p>I have another associative array with same keys as below:</p>
  <pre><code>$arrayWithRequiredKeys = array(
      'a' =&gt; 'Fruits',
      'b' =&gt; 'Leaves',
      'c' =&gt; 'Roots',
      'd' =&gt; 'Veggies',
      'e' =&gt; 'Meat'
  );
  </code></pre>
  <p>I need the keys of <code>$baseArray</code> to be replaced by the values from the respective keys of <code>$arrayWithRequiredKeys</code> such that the output array is as follows:</p>
  <pre><code>$desiredOutput = array(
      'Fruits'    =&gt; array('apple', 'mango'),
      'Leaves'    =&gt; array('lettuce', 'spinach'),
      'Roots'     =&gt; array('carrots', 'radish'),
      'Veggies'   =&gt; array('beans', 'okra'),
      'Meat'      =&gt; array('chicken', 'mutton')
  );
  </code></pre>
  <p>Is there any php inbuilt function to perform the above job? Or do I have to create a customised function?</p>
  <p>Thanks in advance!</p>