explode和implode的运用

时间:2022-02-23 05:36:24
 $kesu_list=DD('Kesu.Kesu')->kesu_list();
 foreach($kesu_list[0] as $key=>$val){
     $reason_id_list[]['reason_id']=$val['reason_id'];
 }
 foreach($reason_id_list as $k=>$v){
     $reason_id_list_new[]=explode(",",$v['reason_id']);
 }
 if($reason_id_list_new){
     $tousu_content=DD('Kesu.Kesu')->reason_id_list_new($reason_id_list_new);
 }
 foreach($tousu_content as $k3=>$v3){
     $tousu_content_list[]['reason_info'] = implode(",",$v3);
 }
 foreach($kesu_list[0] as $k4=>$v4){
     $kesu_list_new[] = array_merge($v4,$tousu_content_list[$k4]);
 }