The array_uintersect_uassoc() function is an inbuilt function in PHP which is used to computes the intersection of two arrays. There is the role of a callback function which helps in comparing and computing the indexes values, It compares the keys. It also compares the values inside the two or more arrays using two user-defined functions and then returns the matches. The array_uintersect_uassoc() returns an array containing all the values of the first array that present in all the arguments. For comparisons, the keys are used in the first function and that value is used in the second one.
array array_uintersect_uassoc( $array1, $array2, $array3..., $function_key, $function_value )
Parameters: This function accepts multiple parameters as mentioned above and described below:
- array1: This is the first array which is mandatory and used to compare with other arrays.
- array2: This is the second array which is mandatory and used to compare against the first array and other arrays.
- array3 and others array: It is optional parameters. This is the array used to compare with other arrays.
- function_key: It is the required parameters. It is the name of the user-defined function that compares the array keys.
- function_value: It is required parameters. It is the name of the user-defined function that compares the array values.
Return Value: It returns an array containing all the values of array1 that are present in all the arguments.
Below programs illustrate the array_uintersect_uassoc() Function in PHP:
Array ( [a] => green [b] => brown )
Array (  => Geeks  => Geeks1 )
- How to get the function name inside a function in PHP ?
- PHP 5 vs PHP 7
- PHP | Get PHP configuration information using phpinfo()
- PHP | php.ini File Configuration
- How to import config.php file in a PHP script ?
- PHP | imagecreatetruecolor() Function
- PHP | fpassthru( ) Function
- PHP | ImagickDraw getTextAlignment() Function
- PHP | Ds\Sequence last() Function
- PHP | Imagick floodFillPaintImage() Function
- Function to escape regex patterns before applied in PHP
- PHP | array_udiff_uassoc() Function
- PHP | geoip_continent_code_by_name() Function
- PHP | GmagickPixel setcolor() function
- PHP | opendir() Function
- PHP | cal_to_jd() Function
- PHP | stream_get_transports() Function
- PHP | Ds\Deque pop() Function
- PHP | SimpleXMLElement children() Function
- PHP | array_intersect_ukey() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.