let dataArray = [];
let id = 23;
let num = 12;
let dogTrialSet = 15;
let catTrialSet = 23;
encountering an issue here
dataArray.push({id:{num:num, dogTrialSet:dogTrialSet, catTrialSet:catTrialSet}});
sending AJAX request to PHP
[dataArray] => Array
(
[0] => Array
(
[id] => Array
(
[num] => 12
[dogTrialSet] => 15
[catTrialSet] => 23
)
)
)
I'd like [id] => Array(...)
to be changed to [23] => Array(...)
;
Thank you