I am trying to select a variable from an array (at least I think it's stored as an array):
$data = json_encode($response);
file_put_contents('file.txt', $data);
gives
"status":200,"response":{
"api_id":"0f42d6be-8ed2-11e3-822e-22135",
"bill_duration":36,
"call_duration":36,
"total_rate":"0.00300"}
}
How can I select the call_duration value (in php)? I've tried $response['call_duration'], which I thought should work but returns nothing?
print_r($response). That is usually the cleanest way to find out how to access elements from the structure.