湖上湖
123456<?php //ver.>4.4.0$a=array('count'=>array(2,3,4,5), 'sku_id'=>array(1,2,3,5)); $o=array();for($i=0,$len=count($a['sku_id']); $i<$len; $i++) $o[]=array('sku_id'=>$a['sku_id'][$i], 'count'=>$a['count'][$i]); var_dump($o); 1234567891011121314151617array (size=4) 0 => array (size=2) 'sku_id' => int 1 'count' => int 2 1 => array (size=2) 'sku_id' => int 2 'count' => int 3 2 => array (size=2) 'sku_id' => int 3 'count' => int 4 3 => array (size=2) 'sku_id' => int 5 'count' => int 5通常是用简单合并就够了12$b=array_combine($a['sku_id'],$a['count']);var_dump($b); 12345array (size=4) 1 => int 2 2 => int 3 3 => int 4 5 => int 5