header('Content-Type: text/html; charset=utf-8'); $a1=array(1=>array("Cat"=>1),3=>array("Dog"=>2),5=>array("Horse"=>6)); $a2=array(1,5); echo "<pre>"; print_r(array_intersect_key($a1,array_flip($a2))); //array_flip键值互换,array_intersect_key根据键值取得交集 echo "</pre>";