我有一个数组,我可以通过以下方式从结果中获取一些详细信息:
$result["transaction"];
当进行此操作时,会显示以下内容:
{ "id": "wt13LbKmJ2",
"location_id": "EYGMFA",
"created_at": "2017-07-01T07:32:57Z",
"tenders":
[ { "id": "C6xMF",
"location_id": "MFA",
"transaction_id": "NvDAOOA9",
"created_at": "2017-07-01T07:32:57Z",
"note": "Offering",
"amount_money": { "amount": 100, "currency": "USD" }, "processing_fee_money": { "amount": 33, "currency": "USD" },
"customer_id": "14QEJXXM5TX",
"type": "CARD",
"card_details": { "status": "CAPTURED",
"card": { "brand": "VI", "last_4": "0000" },
"entry_method": "ON_FILE"
} } ],
"product": "EXTERNAL_API" }
我该如何让我的数组只显示 "100" 而不是 "amount":100? 如果我使用:
$result["transaction"]["id"];
它只会显示id,但我无法显示金额。