嗨朋友们,我正在像这样从服务器(使用 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 格式
提前致谢