我有一個數組,我能夠從我的成績得到一些細節是這樣的:這樣做會顯示如下當PHP如何從一個數組中提取值
$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」,它說「量」:100 如果我使用:
$result["transaction"]["id"];
它將只顯示該ID,但我無法獲得顯示的金額。
的[我如何從JSON中提取數據與PHP?(可能的複製https://stackoverflow.com/questions/29308898/how-做-I-提取物的數據從-JSON與 - PHP) –