0
運行查詢特定客戶銷售歷史記錄後,我得到此JSON。json獲得最大數量
$output=
[
{
"customerID": 52970,
"sale": [
{
"item": "pencil",
}
],
"saleNumber": "25",
},
{
"customerID": 52970,
"sale": [
{
"item": "book",
}
],
"saleNumber": "26",
},
{
"customerID": 52970,
"sale": [
{
"item": "pen",
}
],
"saleNumber": "27",
}
]
,當涉及到諸如customerID
檢索數據,我JSON decode($obj = json_decode($output))
,並獲得CustomerID作爲$ID = $obj->{'customerID'};
如何從這個JSON得到最大saleNumber
太感謝你了! – user3916353 2014-10-06 02:13:32
非常歡迎,如果這是您的答案,請標記:) – Antony 2014-10-06 08:29:52