以上数组为$teacher=array();
$v="";
for($i=0;$i<count($teacher['teacher_class']);$i++){ if(($i+1)==(count($teacher['teacher_class']))){ $v .= $teacher['teacher_class'][$i]; }else{ $v .= $teacher['teacher_class'][$i].','; } } $teacher['teacher_class']=$v;
结果: