I think you want to use something like
'posted_data=' + encodeURIComponent(JSON.stringify(tickets))
Then, on the PHP side you can get it with
$posted_data = $_POST['posted_data'];
$data = json_decode($posted_data);
Instead of using JSON.stringify
, you could also use the JSON as the data and jQuery will convert it to a query string as part of the request. Then, you can use the individual components in $_POST
.