PHP array_udiff() Function

What is array_udiff() Function?


The "array_udiff()" function computes the difference of arrays by using a callback function for data comparison.



In the above syntax "array2" is compared with "array1" in a user defined function,to return the elements of "array1" in an array.

Example :

function funct1($x1,$x2)
if ($x1===$x2)
return 0;
return 1;
Result :

Array ([c]=> Apple)

In the above example the arrays are compared for difference using "funct1", then the difference values are returned in an array.

PHP Topics

Ask Questions

Ask Question