remove only those keys that are not present in another array
<p>I have 2 arrays</p>

<pre><code>$arr1 = array(
  'a' =&gt; array(some values here),
  'b' =&gt; array(some more values here),
  'c' =&gt; array(some more and more values here)
);
</code></pre>

<p>and </p>

<pre><code>$arr2 = array('a','c');
</code></pre>

<p>You can see that $arr2 have 2 values (a,c)</p>

<p>I want to keep those keys in $arr1 whose values are present in $arr1 (maintaining key-value association), and want remove all other values that are not in $arr2 </p>

<p>so, output will be</p>

<pre><code>$arr1 = array(
  'a' =&gt; array(some values here),
  'c' =&gt; array(some more and more values here)
);
</code></pre>

<p>How can I achieve this?</p>
