PHP: Splice-like multiple index array removal/extract
<p>Is there a <strong>native</strong> function to remove multiple indexes from an array and then return source array without removed objects or vice versa, to keep only required <strong>indexes</strong> while removing the rest.</p>

<p>Example:</p>

<pre><code>$source = array('index1' =&gt; 1, 'index2' =&gt; 2, 'index3' =&gt; 3, 'index4' =&gt; 4);
json_encode( array_extract( $source, array('index2','index4'))); // returns array('index2' =&gt; 2, 'index4' =&gt; 4);
</code></pre>

<p>or:</p>

<pre><code>json_encode( array_except( $source, array('index1','index4'))); // returns array('index2' =&gt; 2, 'index3' =&gt; 3);
</code></pre>
