array_uintersect_uassoc

It finds  the intersection of arrays with additional index check, compares data and indexes by a callback functions

Example

<?php
echo “<pre>”;
$array1 = array(“a” => “php”, “b” => “asp”, “c” => “AS”, “JS”);
$array2 = array(“a” => “PHP”, “B” => “asp”, “AS”, “JS”);
print_r(array_uintersect_uassoc($array1, $array2, “strcasecmp”, “strcasecmp”));
?>

Output

Array
(
[a] => php
[b] => asp
)