PHP array_uintersect() Function

PHP array_uintersect() Function

The array_uintersect() function in PHP calculates the intersection of arrays by comparing the data by a callback function. It returns an array containing all the values of the first input array that are present in all the arguments.

Syntax

Parameter

array1(required)– This array represents the first input array.

array2(required)– This array represents the second input array.

array3….(optional)– It represents more arrays to compare against.

value_compare_func(required)– This parameter represents a string that describe a callable comparison function. The comparison function returns an integer greater(<), equal to(=), or less than( >) than 0 if the first argument is greater(<), equal to(=), or less than( >) than the second argument.

Return

This function returns an array containing all the values of the first input array that are present in all the given arrays.

Example 1

Output

Example 2

Output

Example 3

Output