I have a JS array, which I convert to JSON
JS
mycode[0][0]=true
mycode[0][1]="element1"
mycode[0][2]=400
mycode[0][3]=150
mycode[0][4]=148
mycode[0][5]=148
turned into JSON:
[
[
true,
"element1",
400,
150,
148,
148
]
]
Now I push this to PHP
PHP code:
$decoded = json_decode($_GET["q"]);
$response=$q[0];
echo $response;
and it outputs a letter or a symbol as JSON was a string.
If I use $decoded[0][0] or $decoded[0] instead of $q[0] I get nothing...
What am I actually doing wrong?
What do I want? I need to have the same array I had in JS, just in PHP (the array will later be used in a PHP function)