Remove common indexes of array <p>I have some indexes that I need to remove from main array. For example:</p> <pre><code>$removeIndex=array(1,3,6); $mainArray=array('1'=&gt;'a','2'=&gt;'b','3'=&gt;'c','4'=&gt;'d','5'=&gt;'e','6'=&gt;'f'); </code></pre> <p>I want end result like:</p> <pre><code> $mainArray=array('2'=&gt;'b','4'=&gt;'d','5'=&gt;'e'); </code></pre> <p>I know we have <code>array_slice</code> function in PHP, which can be run in loop, but I have very huge data and I want to avoid looping here.</p>