三行简单代码:
$input = @file_get_contents("php://input");
$event_json = json_decode($input,true);
print_r($event_json);我使用了前2行将json数据转换为php中的数组,第三行打印了以下数组(我在这里显示的部分):
Array
(
[created] => 1326853478
[livemode] =>
[id] => evt_00000000000000
[type] => charge.succeeded
[object] => event
[request] =>
[pending_webhooks] => 1
[api_version] => 2014-07-26
[data] => Array
(
[object] => Array
(
[id] => ch_00000000000000
[object] => charge
[amount] => 100
[amount_refunded] => 0我的问题是:如何回显数量( 100)或amount_refunded ( 0)?
发布于 2015-11-12 14:43:12
echo $event_json['data']['object']['amount'];
echo $event_json['data']['object']['amount_refunded'];https://stackoverflow.com/questions/33673819
复制相似问题