title: Select values from an array by array of keys
body: <p>I have two arrays of the same length containing some values.</p>
  
  <pre><code>$a = array("a","b","x","x");
  $b = array("f","g","g","h");
  </code></pre>
  
  <p>Now I want to get the values from <code>$b</code> at the index postions from where <code>$a</code> is <code>x</code>.</p>
  
  <pre><code> $ids = array_keys($a, 'x');
   $res = ???($b,$ids);
   print_r($res);
  </code></pre>
  
  <p>So what function will give me an Array containing <code>g</code> and <code>h</code>. Or is there even a more elegent (e.g. not using <code>array_keys()</code>) to do this?</p>