【发布时间】:2015-01-15 09:15:06
【问题描述】:
我想知道从这样的 JSON 响应中获取值的最佳方法是什么?
{
"customer": {
"link": {
"url": "https://api.neteller.com/v1/customers/CUS_0d676b4b-0eb8-4d78-af25-e41ab431e325",
"rel": "customer",
"method": "GET"
}
},
"transaction": {
"merchantRefId": "20140203113703",
"amount": 2500,
"currency": "EUR",
"id": "176391453448397",
"createDate": "2014-02-03T18:50:48Z",
"updateDate": "2014-02-03T18:50:51Z",
"status": "Accepted",
"fees": [
{
"feeType": "Service_fee",
"feeAmount": 71,
"feeCurrency": "EUR"
}
]
},
"links": [
{
"url": "https://api.neteller.com/v1/payments/176391453448397",
"rel": "self",
"method": "GET"
}
]
}
我已经将响应存储在一个变量中:
$content = json_decode($data['content']);
如何在 PHP 中回显这些值?假设我想要merchantRefId。谢谢!
【问题讨论】: