$aa = array("手机号", "first","keyword1","keyword2","keyword3","keyword4", "remark"); $bb = array("手机号", "first","keyword1","keyword2","keyword3","remark"); $ab = array_diff($bb,$aa); $abc = array_diff($aa,$bb); echo '<pre>'; var_dump($ab); # 错误 var_dump($abc); # 正确
数组的放法会对 array_diff 的判断有影响