array_uintersect_assoc

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

Example

<?php
function func1($arg1,$arg2)
{
if ($arg1===$arg2)
{
return 0;
}
return 1;
}
echo “<pre>”;
$array1=array(“a”=>”PHP”,”b”=>”JSP”,”c”=>”AS”);
$array2=array(a=>”PHP”,b=>”ASP”,c=>”JS”);
print_r(array_uintersect_assoc($array1,$array2,”func1″));
?>

Output

Array
(
[a] => PHP
)

Share