Menu Riverview Church

ARRAY_UDIFF

Computes the difference of arrays by using a callback function for data comparison

SYNTAX

array_udiff ( array $array1 , array $array2 [, array $... ], callable $value_compare_func ) : array

PARAMETERS

array1

The first array.

array2

The second array.

value_compare_func

The callback comparison function.

The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.

callback ( mixed $a, mixed $b ) : int

RETURN

Returns an array containing all the values of array1 that are not present in any of the other arguments.

EXAMPLES

ARRAY1 ARRAY2 VALUE_COMPARE_FUNC

Array
(
    [b] => 1
    [d] => 3
)

...

Array
(
    [b] => 1
    [d] => 3
)

PHP