arrayarray_diff(array$array1,array$array2[,array$...]) 根据数组的值,返回比较数组的差集,在第一个数组而不再其他数组的值 1. [代码] array_diff $arr1 = ['bb'='bbb','a'='aaa','e'='ccc','d'='ddd'];$arr2 = ['c'='bbb'
根据数组的值,返回比较数组的差集,在第一个数组而不再其他数组的值
1. [代码]array_diff
$arr1 = ['bb'=>'bbb','a'=>'aaa','e'=>'ccc','d'=>'ddd']; $arr2 = ['c'=>'bbb','d'=>'ccc']; $arr = array_diff($arr1,$arr2); echo '<pre>'; print_r($arr); result: Array ( [a] => aaa [d] => ddd )