title: How do I replace assocative array keys with other words from second array?
body: <p>I am trying to replace an array key (= single letter) with a word. I have a associative array and a $mapKeyArray with the replacement words  </p>
  
  <pre><code>$inputArray = ['P' =&gt; 72,'T' =&gt; 0,'U' =&gt; 1,'E' =&gt; 0];
  
  function cb_replaceWords($a) {
      $mapKeyArray = array('P' =&gt; 'Pink', 'T' =&gt; 'Top', 'U' =&gt; 'Union', 'E' =&gt; 'EX');
      foreach($a as $key) {
  //        $a[$key] = $mapKeyArray[$key];
          $a[$key];
      }
      return $a;
  }
  
  $outputArray = array_map("cb_replaceWords", $inputArray);
  </code></pre>