日期:2014-05-17 浏览次数:20616 次
$arr=array( array('name' => 'aa','id' => '456'), array('name' => 'bb','id' => '25',), array('name' => 'cc','id' => '25',), array('name' => 'dd','id' => '456',), );
$newArr=array(); foreach($deals_info as $key=>$value){ if(!isset($newArr[$value['id']])){ $newArr[$value['id']][]=$value['name']; }else{ foreach($newArr as $k=>$v){ if($k==$value['id'] and !in_array($value['name'],$newArr[$k])){ $newArr[$k][]=$value['name']; } } } }