$array = array( array('id'=>'3','name'=>'tom'), array('id'=>'5','name'=>'jerry'), array('id'=>'24','name'=>'spike')); $newArray1 = array_column($array,NULL,'id');var_dump($newArray1);//结果array( '3'=>array('id'=>'3','name'=>'tom'), '5'=>array('id'=>'5','name'=>'jerry'), '24'=>array('id'=>'24','name'=>'spike')) $newArray2 = array_column($array,NULL,'name');var_dump($newArray2);//结果array( 'tom'=>array('id'=>'3','name'=>'tom'), 'jerry'=>array('id'=>'5','name'=>'jerry'), 'spike'=>array('id'=>'24','name'=>'spike'))