1
喜的朋友我得到來自服務器的JSON(使用Kohana的框架3.0)這樣的....獲得必需的JSON格式
{
"aaData": [
{
"regNo": "1",
"regDate": "2025-05-12",
"patientName": "Ratna",
"address": "saasgasgasga",
"city": "Hyderabad",
"phno": "2147483647",
"mrgStatus": "single",
"religion": "1",
"gender": "male",
"fathername": "Yohan",
"status": "2",
"age": "25"
}
]
}
,但我想下面的格式
{
"aaData": [
[
"1",
"2025-05-12",
"Ratna",
"saasgasgasga",
"Hyderabad",
"2147483647",
"single",
"1",
"male",
"Yohan",
"2",
"25"
]
]
}
Kohana的控制器
public function action_index()
{
$table = new Model_patientdetails();
$log =$table ->get_all();
$output = array("aaData" => $log);
$this->auto_render=false;
echo json_encode($output);
}
請建議我如何獲得所需的JSON格式
在此先感謝
我試過,但得到相同的輸出 – Clarence
對不起,我固定的代碼現在 – odiszapc
雅公司工作,我需要..感謝了很多花花公子.. – Clarence