On MySQL I have this JSON value
{"length":1847,"data":[0,0,0,0,-46,37]}
On PHP I need to string in array the "data" objects, so I tried:
$json = $row['wave'];
$json_array = json_decode($json);
$json_wave = $json_array["data"];
It gives me internal server error 500, so I tried:
var_dump(json_decode($json));
What I got is:
object(stdClass)#7 (5) {
["length"]=>
int(1847)
["data"]=>
array(3694) {
[0]=>
int(0)
[1]=>
int(0)
[2]=>
int(0)
[3]=>
int(0)
[4]=>
int(-46)
[5]=>
int(37)
}
}
I need to output this string 0,0,0,0,-46,37, why is my code not working?
$json_array = json_decode($json,TRUE);to make it associative array then use$json_wave = $json_array["data"];