spliting an array without foreach
<p>So I have an array of items</p>

<pre><code> $arr1 = Array(266=&gt;"foo",178=&gt;"bar",3="foobar");
</code></pre>

<p>and then I have an of array of numbers like this</p>

<pre><code> $arr2 = Array(0 =&gt; 266, 1 =&gt; 178);
</code></pre>

<p>and so what I want to do is split array one into two arrays </p>

<p>where the values of $arr2 that match the index of $arr1 are moved to a new array so I am left with</p>

<pre><code> $arr1 = Array(3="foobar");

 $arr2= Array(266=&gt;"foo",178=&gt;"bar");
</code></pre>

<p>that said I know I could do this with a foreach loop but I wonder if this is a simpler and faster way to do this </p>

<p>something like array_diff would be could but I don't think that will work</p>
