PHP array_uintersect_assoc() Function
Last Updated : 17 Mar 2025
The array_uintersect_assoc( ) function is an inbuilt function of PHP. The array_uintesect_assoc() function compares two or more arrays, and then returns an array containing the elements from the first array. This function was introduced in PHP 5.0.
Syntax
Parameter
| Parameter | Description | Is compulsory |
|---|---|---|
| array1 | Array to compare from. | compulsory |
| array2 | Array to compare against. | compulsory |
| array3 | More arrays to compare against. | Optional |
| Value_compare_function | The name of the user made function. | compulsory |
Returns
The array_uintersect_assoc( ) function returns an array containing the entries from array1 that are present in all the arguments.
Example 1
Output:
Array
(
[a] =>php
)
Example 2
Output:
Array
(
[a] => dell
)
Example 3
Output:
Array
(
[a] => Apple
)
Example 4
Output:
Array
(
[a] => Java
[d] =>php
)
Next TopicPhp-array-uintersect-function