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>";

 

posted on 2014-02-27 18:35  IT使者  阅读(284)  评论(0编辑  收藏  举报