时间:2021-07-01 10:21:17 帮助过:16人阅读
$arra = array(
0 => array(
'id' => 0,
'send_mobile'=> '13267310236',
'c_content'=>'天气很热注意防暑'
),
1 => array(
'id' => 1,
'send_mobile'=> '13267310285',
'c_content'=>'天气很热注意防暑'
),
2 => array(
'id' => 2,
'send_mobile'=> '13267310126',
'c_content'=>'天气很热注意防暑'
),
3 => array(
'id' => 3,
'send_mobile'=> '13267310166',
'c_content'=>'天气防暑'
)
);
$arrb = array();
foreach ($arra as $v){
$b = $v['c_content'];
if(isset($arrb[$b]))
$arrb[$b]['send_mobile'] .= ','.$v['send_mobile'];
$arrb[$b] = isset($arrb[$b])?$arrb[$b]:$v;
}
$arrb = array_values($arrb);
print_r($arrb);
?>