Fetching data from Key Value JSON object
This question already has an answer here:
Try this :
$response=json_decode($json,true);
echo $amount=$response['Body']['stkCallback']['CallbackMetadata']['Item']['0']['Value'];
echo $TransactionDate=$response['Body']['stkCallback']['CallbackMetadata']['Item']['1']['Value'];
echo $PhoneNumber=$response['Body']['stkCallback']['CallbackMetadata']['Item']['2']['Value'];
You have all the values in variables now.
链接地址: http://www.djcxy.com/p/38060.html下一篇: 从键值JSON对象获取数据