What you need should work fine, but the JSON object turns into an array of arrays when it is provided to the given POST. You will get something like this:
["object1"]=>
array(1) {
["object2"]=>
array(1) {
[0]=>
array(2) {
["string1"]=>
string(4) "val1"
["string2"]=>
string(4) "val2"
}
}
}
}
So object1 is an array that contains all the other data. If you do
foreach ($_POST as $key => $val) {
echo $key . " > " . $val
}
"object1 > Array". , . , , , , , .