$a=array('1'=>'one','2'=>'two','3'=>'three','4'=>'four','5'=>'five',....);$b=array(2,5,4,1,3,.....);//数组a的key顺序$c=array('2'=>'two','5'=>'five','4'=>'four','1'=>'one','3'=>'three',....);如何将数组a按照数组b值中key的顺序重新排序得到数组c?(可以不用循环么?)
2 回答
繁花不似锦
TA贡献1851条经验 获得超4个赞
$a=array('1'=>'one','2'=>'two','3'=>'three','4'=>'four','5'=>'five',....);$b=array(2,5,4,1,3,.....);//数组a的key顺序$c=array();foreach($bas$d)$c[$d]=$a[$d];print_r($c);
添加回答
举报
0/150
提交
取消