PHP array_udiff() Function

PHP array_udiff() Function

The array_udiff() function in PHP calculates the difference of arrays by using a callback function for data comparison.

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 does not exists in any of the other given arrays.

Example 1

Output

Example 2

Output

Example 3

Output

Example 4

Output