简单教程
提交运行
代码编辑器:
<?php function myfunction_key($a,$b) { return $a==$b ? 0 : ($a>$b)?1:-1; } function myfunction_value($a,$b) { return $a===$b ? 0 : ($a>$b)?1:-1; } $a1=array("a"=>"red","b"=>"green","c"=>"blue"); $a2=array("a"=>"red","b"=>"green","c"=>"green"); $result=array_uintersect_uassoc($a1,$a2,"myfunction_key","myfunction_value"); print_r($result);
运行结果: