Trouble decoding JSON string with PHP
- by Anthony
I'm trying to send an array of objects from JS to PHP using JSON. I have an array of players as follows:
var player;
var players = new Array();
//loop for number of players
player = new Object();
player.id = theID;
players[i] = player;
Then my AJAX call looks like this:
JSONplayers = JSON.stringify(players);
$.ajax({
type: "POST",
url:…