我有一个像这样的数组
Array
(
[83YaO] => Array
(
[0] => admin@gmail.com
)
[78hk0] => Array
(
[0] => vero@gmail.com
)
)
和另一个数组,形式为
Array
(
[83YaO] => Array
(
[0] => admin@gmail.com
[1] => asdsad@gmail.com
[2] => singh@gmail.com
)
)
我如何找到添加联系人之类的差异
Array
(
[83YaO] => Array
(
[0] => admin@gmail.com
[1] => singh.pratibha1432@gmail.com
)
[78hk0] => Array
(
[0] => vero@gmail.com
)
)
并拒绝这样的联系人:
[83YaO] => Array
(
[0] => admin@gmail.com
)
答案 0 :(得分:1)
将array1与array2或更多其他数组进行比较,并返回array1中其他数组中不存在的值。
$array1 = array("a" => "green", "red", "blue", "red");
$array2 = array("b" => "green", "yellow", "red");
$result = array_diff($array1, $array2);
print_r($result);