I have a multidimensional array I am trying to pass in as data through a jQuery ajax call to my PHP script.
I declared lobby_state with the following code:
lobby_state = [];
lobby_state.users = 3;
lobby_state.user = [];
lobby_state.user[0].username = 'john';
lobby_state.user[0].age = 30;
lobby_state.user[0].sex = 'M';
lobby_state.user[1].username = 'kim';
lobby_state.user[1].age = 17;
lobby_state.user[1].sex = 'F';
lobby_state.user[2].username = 'mary';
lobby_state.user[2].age = 51;
lobby_state.user[2].sex = 'F';
I'm passing in a total of 2 values, a simple string, and the multidimensional array:
$.ajax({
type: "POST",
url: "app/lobby/lobby-process.php",
data: {
'action': 'update',
'state': lobby_state
},
dataType: "json",
success: function(data){
...
When I execute this, it seems to completely ignore the lobby_state value, and it only passes in the 'action' value, as shown in the Chrome developer console request values below.

I tried following all the examples of passing in arrays but nothing seems to work. Am I missing something?