php合并重复数据合并 phpexcel 合并单元格( 二 )


$tem_moeny = array();
if($arr['name']== $tArr['name']$arr['age']== $tArr['age']){
$id .= '+'.$tArr['id'];
$n_arr['id'] = $id;
$n_arr['name'] = $arr['name'];
$n_arr['age'] = $arr['age'];
if(is_array($arr['moeny'])){
array_push($n_arr['moeny'], $tArr['moeny']);
}else{
$tem_moeny [] = $arr['moeny'];
$tem_moeny [] = $tArr['moeny'];
}
$tem_moeny[] = $tArr['moeny'];
$n_arr['moeny'] = $tem_moeny;
$newArr[] = $n_arr ;
}
}
if($id == $arr['id']){
$newArr[] = $arr ;
}
}
print_r($newArr);
?
php合并重复数据合并的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于phpexcel 合并单元格、php合并重复数据合并的信息别忘了在本站进行查找喔 。

推荐阅读