php: loop through json array
First you have to decode your json :
$array = json_decode($the_json_code);
Then after the json decoded you have to do the foreach
foreach ($array as $key => $jsons) { // This will search in the 2 jsons foreach($jsons as $key => $value) { echo $value; // This will show jsut the value f each key like "var1" will print 9 // And then goes print 16,16,8 ... }}
If you want something specific just ask for a key like this. Put this between the last foreach.
if($key == 'var1'){ echo $value;}