I'm trying to send a multidimensional array from php to Javascript/jQuery but I'm having a problem.
When I'm sending index 0 via json_encode($array);, the client receives the response in the format I want:
[[0,0],[1,0.031410759078128],[2,0.062790519529313],[3,0.094108313318514].etc..]
When I inspect with firebug, the index 0 array sent doesn't seem to arrive with JSON?
When I send any other index of the array, the client receives the array in this format(which I don't want):
{"1":[1,0.031410759078128],"2":[2,0.062790519529313],"3":[3,0.094108313318514].etc..}
when I inspect the arrays received by the client when the index is anything other than 0, I can clearly see that it was sent using JSON.
What's the problem, and how can I get all of my indexed arrays sent using the same format as my array[0] ?
Here's my php code:
$strJEncoded = json_encode($array);
echo $strJEncoded;
Here's my JS/Jquery code:
$res = jQuery.parseJSON(response);