I have a php page which gets some data in mysql database and return a json file, and then I call this json file with an ajax call :
$.ajax({
type: "POST",
dataType: "json",
url: "get_players_stats.php", //Relative or absolute path to players_stats file
success: function(data) {
var list = [];
$.each(data, function() {
list.push([this.time, this.playersonline]);
})
console.log(list);
}
});
the console.log(list);
shows me this :
[["-1009843200000", "1"], ["-252460800000", "2"], ["-94694400000", "3"], ["31536000000", "2"],....
but instead I want it to look like this :
[[-1009843200000, 1], [-252460800000, 2], [-94694400000, 3], [31536000000, 2],....
How can I do that ?