Maybe you can do it, but you should do it completely manually:
{
"content[0]": "a",
"content[1]": "b",
"content[2]": "c",
"content[multi][0]": "d"
}
$_POST['content'] will look like this:
Array(
0 => "a",
1 => "b",
2 => "c",
multi => Array(
0 => "d"
)
)
It would be much simpler:
{
"blob" : JSON.stringify(data_or_array_or_whatever)
}
In PHP you can get it:
$data = json_decode($_POST['blob'], true);
This requires the json2.js library for older browsers.
I would go after the latter, as in the first you are likely to write your own serializer: P - that is why we have JSON.
source
share