How to reset indexes in array_diff result?
you can use array_values(array_diff($arr1, $arr2));
if order doesn't matter
You should run array_values()
on the result and this would give you a new array with indexes starting at 0.
This is a known shortcoming of array_diff()
, check the php docs.