title: PHP Associative Arrays - Return all key value pairs where key is present in a validation list?
body: <p>For example:</p>
  
  <pre><code>$searchParameters = array(
      'parameter1' =&gt; 'value1',
      'parameter2' =&gt; 'value2',
      'parameter3' =&gt; 'value3',
  );
  
  $allowedParamters = array('parameter1','parameter2');
  </code></pre>
  
  <p>What's the best way to get <code>$searchParameters</code> containing only the allowed pairs?</p>