Is there a PHP function to remove certain array elements from an array?
E.g., I have an array (A) with values and another array (B) from wh
Use array_diff()
$new_array = array_diff($arrayB, $arrayA);
will return an array with all the elements from $arrayB that are not in $arrayA.
To do this with associative arrays use array_diff_assoc().
To remove a single value use:
unset($array[$key]);
You can of course loop that to do the equivalent of the array functions but there's no point in that.