xxxxxxxxxx
$arr1 = array('blue', 'green', 'red');
$arr2 = array('BLUE', 'Purple', 'Red');
$loose_matches = array_uintersect($arr1, $arr2, 'strcasecmp');
print_r($loose_matches) // array('blue', 'red');
xxxxxxxxxx
<?php
function myfunction($a,$b)
{
if ($a===$b)
{
return 0;
}
return ($a>$b)?1:-1;
}
$a1=array("a"=>"red","b"=>"green","c"=>"blue");
$a2=array("a"=>"blue","b"=>"black","e"=>"blue");
$result=array_uintersect($a1,$a2,"myfunction");
print_r($result);
?>
xxxxxxxxxx
<?php
$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
$array2 = array("a" => "GREEN", "B" => "brown", "yellow", "red");
print_r(array_uintersect($array1, $array2, "strcasecmp"));
?>