I have a json object from a curl get request.
// Curl Stuff
$resp = curl_exec($curl);
{"food": {"id":585897,"foodGroup":"meats","calories":1109,"foodTier":30}}
I saved it in a variable with json_decode
$data = json_decode($resp, TRUE);
I've tried accessing the data in a couple ways but I get no response
echo $data[0][1];
echo $data[0]['id'];
Also if someone can point me in the right direction of looping through this data I would appreciate that.