PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8
array_diff - Computes the difference of arrays
array_diff( array$array, ... array$arrays ): array
Compares array against one or more other arrays and returns the values in array that are not present in any of the other arrays.
The array to compare from
Arrays to compare against
Returns an array containing all the entries from array that are not present in any of the other arrays. Keys in the array array are preserved.
This function only checks one dimension of a n-dimensional array. Of course you can check deeper dimensions by using array_diff($array1, $array2);.
Show all examples for array_diff