"星期一","xq2"=>"星期二","xq3"=>"星期三"];while ($row = mysql_fetch_assoc($res)) { $arr[] = ["student_name" => $row["student_name"], "course_name" => $row["course_name"], "mobile" => $row["mobile"], "sub" => $sub];}$a = array("curPage" => $page, "totalCount" => $total, "totalpage" => $totalpage, "data" => $arr, "sql" => "$sql");//echo json_encode($a);echo json_encode($arr);
参考:http://www.cnblogs.com/zhangmiaomiao/p/6013408.html