I'm sending an ajax request from js to php.
In the php code I create some 2-D array like this:
$arr = array();
for ($i=1; $i<=100; $i++){
$array[$i][0] = rand(0,100000);
$array[$i][1] = rand(0,100000);
$array[$i][2] = rand(0,100000);
}
header("Content-Type: application/json", true);
echo json_encode($CalcTable);
exit;
On the js file, I get the data parameter (the parameter that returned from the ajax done function) like an object that contains 100 arrays inside.
I want to convert this returned object to a js array that contains all the 100 arrays inside it (and all each array contains the 3 arrays with the random values).
Thanks!
$.getJSON()call, then it's already been decoded into a native js array and you just start using it.