PHP array_udiff_uassoc() Function

PHP array_udiff_uassoc Function


Definition :

The array_udiff_uassoc() function compares the keys and values of two or more arrays and returns the differences using the user-defined key and value comparison functions.

Syntax:

The basic syntax of the array_udiff_uassoc() function is given with:

 array_udiff_uassoc(array1array2...value_compare_functionkey_compare_function);

Parameters

The array_udiff_uassoc() function accepts the following parameters.

Parameter Description
array1 Required. Specifies the array to compare from.
array2 Required. Specifies an array to compare against.
... Optional. Specifies more arrays to compare against.
value_compare_function Required. Specifies a callback function to use for value comparison.
key_compare_function Required. Specifies a callback function to use for key comparison.

 Example : Compare the keys and values of two arrays (using two user-defined functions for comparison) and return the differences:

Output : 

Array
(
    [c] => House
)