arrayarray_intersect(array$array1,array$array2[,array$...]) 返回一个数组,该数组的值在每个数组都有 1. [代码] array_intersect $arr1 = ['a'='aaa','b'='bbb','c'='ccc'];$arr2 = ['bb'='ccc','dd'='aaa'];$arr = array_intersect($
返回一个数组,该数组的值在每个数组都有
1. [代码]array_intersect
$arr1 = ['a'=>'aaa','b'=>'bbb','c'=>'ccc']; $arr2 = ['bb'=>'ccc','dd'=>'aaa']; $arr = array_intersect($arr1, $arr2); echo '<pre>'; print_r($arr); result: Array ( [a] => aaa [c] => ccc )