Easy Tutorial
❮ Func Mysqli Autocommit Php Magic Constant ❯

PHP array_uintersect_assoc() Function

Complete PHP Array Reference Manual

Example

Compare the keys and values of two arrays (using a built-in function to compare keys and a user-defined function to compare values), and return the intersection:


Definition and Usage

The array_uintersect_assoc() function is used to compare the keys and values of two (or more) arrays and return the intersection.

Note: This function uses a built-in function to compare keys and a user-defined function to compare values!

This function compares the keys and values of two (or more) arrays and returns an intersection array, which includes all keys and values present in the compared array (array1) that are also present in any other parameter arrays (array2 or array3, etc.).


Syntax

Parameter Description
array1 Required. The first array to compare with other arrays.
array2 Required. An array to compare against the first array.
array3,... Optional. Additional arrays to compare against the first array.
myfunction Required. A string defining a callable 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.

Technical Details

Return Value: Returns an intersection array, which includes all keys and values present in the compared array (array1) that are also present in any other parameter arrays (array2 or array3, etc.).
PHP Version: 5+
--- ---
❮ Func Mysqli Autocommit Php Magic Constant ❯