array_intersect_uassoc

Syntax:array array_intersect_uassoc ( array $array1 , array $array2 [, array $ … ], callable $key_compare_func )
Description:Computes the intersection of arrays with additional index check, compares indexes by a callback function

<?php
$array1 = array("a" => "green", "b" => "brown", "c" => "Yellow", "red");
$array2 = array("a" => "GREEN", "B" => "brown", "yellow", "red");

print_r(array_intersect_uassoc($array1, $array2, "strcasecmp"));
?>
  

OUTPUT

Array ( 
[b] => brown 
)