Copyright © tutorialspoint.com
| array_uintersect_assoc( $array1, $array2 [, $array3 ..., $data_compare_func] ); |
This function returns an array containing all the values of array1 that are present in all the arguments array2, array3.
| Parameter | Description |
|---|---|
| array1 | Required. Specifies an array. |
| array2 | Required. Specifies an array to be compared with the first array. |
| array3 | Optional. Specifies an array to be compared with the first array. |
| data_compare_func | Required. The name of the user-made function. |
Try out following example:
<?php
$array1 = array("a"=>"green", "b"=>"brown", "c"=>"blue", "red");
$array2 = array("a"=>"GREEN", "B"=>"brown", "yellow", "red");
print_r(array_uintersect_assoc($array1, $array2, "strcasecmp"));
?>
|
This will produce following result:
Array
(
[a] => green
)
|
Copyright © tutorialspoint.com