Menu Samaritan's Purse

ARRAY_UDIFF_UASSOC

Computes the difference of arrays with additional index check, compares data and indexes by a callback function

SYNTAX

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

PARAMETERS

array1

The first array.

array2

The second array.

value_compare_func

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
key_compare_func

The comparison of keys (indices) is done also by the callback function key_compare_func. This behaviour is unlike what array_udiff_assoc() does, since the latter compares the indices by using an internal function.

RETURN

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

EXAMPLES

ARRAY1 ARRAY2 VALUE_COMPARE_FUNC KEY_COMPARE_FUNC

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

...

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

PHP