Removing Items From an array using PHP
arrays, php
Solution
foreach ($index as $key) {
unset($alpha[$key]);
}
had it as array_unset() before.
Problem
I have two arrays ``` $alpha=array('a','b','c','d','e','f'); $index=array('2','5'); ``` I need to remove the items in the first array that has the index from the second array. (Remove c-index is 2 and f-index is 5) So that the returned array is {'a','b','d','e'} How can i do this using PHP? Thanks Edit Actually I need the final array as follows ``` [0]=>a [1]=>b [2]=>d [3]=>e ``` Unsetting will return the array with same indexes ``` 0 => string 'a' 2 => string 'c' 3 => string 'd' 4 => string 'e' ```