Skip to content
Chung Leong edited this page Jan 10, 2022 · 3 revisions

array_diff - Computes the difference of arrays

array array_diff( array $array1, array $array2 [, $... ] )

array_diff() compares array1 against array2 and returns the difference. It is capable of handling multidimensional arrays, provided the number of elements in each sub-array is known as compile time.

Parameters:

array1 - The array to compare from.

array2 - The array to compare against.

... - Additional arrays to compare against.

Return Value:

An array containing all the entries from array1 that are not present in any of the other arrays.

Version

1.4 and above.

Clone this wiki locally