我正在尝试从此响应中提取 PHP 的价值{ "id": "pi_1FxfIlJtivvUT2vVGgfaIWIZ", "object": "payment_intent", "last_payment_error": "", "livemode": "", "next_action": "", "status": "succeeded", "amount": 538, "charges": { "object": "list", "data": [{ "id": "ch_1FxfImJtivvUT2vVs7YQPJUb", "object": "charge", "amount": 538 }] }}当我尝试:$payment_intentID = $payment_intent->id;它有效,但是当我尝试时:$payment_intentID = $payment_intent->charges->data->id;我得到空有什么问题?谢谢,问候
1 回答
阿波罗的战车
TA贡献1862条经验 获得超6个赞
$payment_intent->charges->data
是一个数组 - 试试这个:
$payment_intent->charges->data[0]->id
- 1 回答
- 0 关注
- 73 浏览
添加回答
举报
0/150
提交
取消