PHP array_uintersect_uassoc() Function

PHP array_uintersect_uassoc Function


Definition : 

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

Syntax:

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

array_uintersect_uassoc(array1array2...value_compare_functionkey_compare_function);

Parameters

The array_uintersect_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.

Example1: following example below Compare the keys and values of two arrays (using two user-defined functions for comparison) and return the matches.

Output : 

Array
(
    [a] => web
)