PHP array_udiff_assoc() Function

What is array_udiff_assoc() Function?


The "array_udiff_assoc()" function computes the difference of arrays with additional index check, compares data by a callback function.



In the above syntax "array1" and "array2" are compared automatically for keys, then in the user defined function checks for the values, then returns an array of differing elements.

Example :

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

Array ( [b] Dog [c] => Horse )

In the above example the two arrays "a1", "a2" are compared for keys then for values to display the different elements.

PHP Topics

Ask Questions

Ask Question