我有2个屁股阵列如下
首先:
array (size=3)
0 =>
array (size=1)
'ma_ncc' => string '999' (length=3)
1 =>
array (size=1)
'ma_ncc' => string '1' (length=1)
2 =>
array (size=1)
'ma_ncc' => string '1' (length=1)
第二
{{1}}
如何比较这些数组(数组为数值)
非常感谢!!!
答案 0 :(得分:0)
使用array_diff()函数。
Example:
<?php
$array1 = array("a" => "green", "red", "blue", "red");
$array2 = array("b" => "green", "yellow", "red");
$result = array_diff($array1, $array2);
print_r($result);
?>
答案 1 :(得分:0)
请尝试使用array_diff_assoc函数
<?php
$array1 = array("a" => "green", "red", "blue", "red");
$array2 = array("b" => "green", "yellow", "red");
$result = array_diff_assoc($array1, $array2);
print_r($result);
?>