php is as follows:
array (size=2)
0 =>
array (size=2)
0 =>
array (size=4)
"id" => int 1
"fid" => int 0
"title" => string "1" (length=12)
"level" => int 9
1 =>
array (size=4)
"id" => int 2
"fid" => int 0
"title" => string "2" (length=12)
"level" => int 8
1 =>
array (size=2)
0 =>
array (size=4)
"id" => int 11
"fid" => int 1
"title" => string "1" (length=12)
"level" => int 0
1 =>
array (size=4)
"id" => int 12
"fid" => int 1
"title" => string "2" (length=12)
"level" => int 0
output using json_encode is as follows:
[
[{
"id": 1,
"fid": 0,
"title": "1",
"level": 9
}, {
"id": 2,
"fid": 0,
"title": "2",
"level": 8
}],
[{
"id": 11,
"fid": 1,
"title": "1",
"level": 0
}, {
"id": 12,
"fid": 1,
"title": "2",
"level": 0
}]
]
the format you want is
"0": [{
"id": 1,
"fid": 0,
"title": "1",
"level": 9
}, {
"id": 2,
"fid": 0,
"title": "2",
"level": 8
}],
"1": [{
"id": 11,
"fid": 1,
"title": "1",
"level": 0
}, {
"id": 12,
"fid": 1,
"title": "2",
"level": 0
}]