arrayarray_intersect_key(array$array1,array$array2[,array$...]) 返回一个数组:该数组的键在每一个数组都存在 1. [代码] array_intersect_key $arr1 = ['a'='abc','b'='bbb','c'='cbd'];$arr2 = ['a'='ccc','c'='aaa','e'='eee'];$a
返回一个数组:该数组的键在每一个数组都存在
1. [代码]array_intersect_key
$arr1 = ['a'=>'abc','b'=>'bbb','c'=>'cbd']; $arr2 = ['a'=>'ccc','c'=>'aaa','e'=>'eee']; $arr = array_intersect_key($arr1, $arr2); echo '<pre>'; print_r($arr); result: Array ( [a] => abc [c] => cbd )