//$course[$i]是要去重的二維數組
foreach ($course[$i] as $v){
$v = join(",",$v);
$temp[] = $v;
}
$temp = array_unique($temp);
sort($temp); //去除索引,重新排序
$temp2=array();
foreach ($temp as $k => $v){
$temp2[$k]['course_name'] = $v;
}
$student[$i]['course']=$temp2;