Possible Duplicate:
How to remove values from an array in PHP?
I have this
$arr1 = array('orange','banana');
$arr2 = array('broccli','tomato','mixedvegies','orange','veg2');
how would I take complete $arr1 from $arr2 so that arr2 has
$arr2 = array('broccli','tomato','mixedvegies','veg2');
array_diff($arr2, $arr1);
array_diff returns an array with all the elements not in the second (or third, fourth... optional args).
You can use array_diff for this:
$uniqueItems = array_diff($arr2, $arr1);