我有两个数组。
检查代码
$array1 = array(0=>'215',1=> '225');
$array2 = array(0=>'225');
$diff_result = array_diff($array1, $array2);
$diff = array_values($diff_result);
print_r($array1);echo "<br>";
print_r($array2);echo "<br>";
print_r($diff_result);echo "<br>";
print_r($diff);
现在我得到答案
Array ( [0] => 215 [1] => 225 )
Array ( [0] => 225 )
Array ( [0] => 215 [1] => 225 )
Array ( [0] => 215 [1] => 225 )
但根据array_diff手册,它应该是
Array ( [0] => 215 [1] => 225 )
Array ( [0] => 225 )
Array ( [0] => 215 )
Array ( [0] => 215 )
可能是什么问题呢