PHP array_diff() Function

The array_diff() function is used to compares an array against one or more other arrays and returns the values in the first array that are not present in any of the other arrays.The array_diff() function compares the values of two (or more) arrays, and returns the differences. This function compares the values of two (or more) arrays, and return an array that contains the entries from array1 that are not present in array2 or array3, etc.

Example -

Example -