手册例子如下, array_intersect_uassoc 回调函数返回 0 则为交集元素, 那么下面 "a" => "green" 和 "a" => "GREEN" 不是交集?
$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
$array2 = array("a" => "GREEN", "B" => "brown", "yellow", "red");
// print_r(array_intersect_uassoc($array1, $array2, "strcasecmp")); // "a" => "green" 为什么不输出?
1
airdge 2018-08-09 11:24:06 +08:00 1
这个函数只使用自定义函数比较键名,不比较键值,所以只输出 b=>brown
|
2
Light3 2018-08-09 11:58:55 +08:00 1
|