array_diff($arr, $arr1);
//比较数组差异 $arr = [1,2,3,4]; $arr1 = [1,2,3]; $diff = array_diff($arr, $arr1); dump($diff); //打印输出如下,函数第二个参数为参数值,没有差异则返回空数组 array(1) { [3] => int(4) }