PHP array_uintersect() function || PHP Arrays

array_uintersect() function in php

Last Updated by Pooja Chikara 20-Apr-20

0 360

PHP array_uintersect() function is used to return the intersection or match values of two or more arrays by comparing the values with the help of a user-defined function. It is an inbuilt function of PHP.


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


  • $array1 is a PHP array which matched values returned by this function.
  • $array2,$array3 and $arrayN are also PHP arrays which values is compared with the values of $array1.
  • user_function is a user defined comparison function which used to calculate the common values of arrays by comparing the values.

Example 1:

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


array_uintersect() function in php


Leave a Reply

    Waiting for your comments