PHP array_udiff_assoc() Function || PHP Array Functions

PHP array_udiff_assoc() function

0 1463

array_udiff_assoc() function of PHP is used to return the difference of two or more arrays by comparing the keys and values of arrays with the help of a user-defined function or the callback function.

It is an inbuilt function of PHP.


array_udiff_assoc($array1, $array2, ........, $arrayN, user_function);


$array1, $array2 and $arrayN are php arrays and user_function is a user define function which used to calculate the difference between arrays and return the unique elements of first array.

Example 1:

function user_function($x,$y)
if ($x===$y)
  return 0;
  return ($x>$y)?1:-1;
echo "<pre>";


Result - PHP array_udiff_assoc()

Best WordPress Hosting


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price

Leave a Reply

    Waiting for your comments