Below is my json
response, I am using json_decode
for converting the response in php object
, 'status' and 'msg' is converted successfully but problem is with 'amt'. How to get 'amt' in php object?
$amt=$response->transaction_details['amt'];
is not working.
RESPONSE :
{"status":1,"msg":"Transactions Fetched Successfully","transaction_details":{"686868686505":{"payid":"293642892","amt":"10.00","txnid":"686868686505","additional_charges":"0.00","productinfo":"SHIRT","firstname":"WILLIAM}}}
CODE :
$response = json_decode($o,true);
$msg = $response['msg'];
$status = $response['status'];
$amt=$response->transaction_details->['amt'];
echo '<br>';
echo $amt;
echo '<br>';
echo $msg;
echo '<br>';
echo $status;
OUTPUT :
Transactions Fetched Successfully
1