Hi Guys,
I am using Yii2 activeController for building REST API, Where the results is returning JSON format which has extra comma (,) in multidimensional arrays!.
Any idea how to remove this?
Example output is as follows
{"groups": {
"Quaasdfaest": {
"headers": [
"Subject Name",
"Foasdfasdfsment",
"Sumasdfasdfasdsment",
"FA + SA"
],
"rows": [
{
"Subject Name": "asdfasdfasd",
"Forasdfasdfent": "E1",
"Sumfoooent": "E2",
"FA + SA": "E1"
},
{
"Subject Name": "asdfasdfasdfasd",
"Foasdfasdfasdfasdment": "-",
"Sumasdfasdfasdfssment": "-",
"FA + SA": "-"
}
], //Extra comma comes here at the end!
}
}
It seems php normal json_encode also did the same!. Is it possible we can overwrite through Yii2 ?