Json解码数组

时间:2013-04-21 19:03:55

标签: arrays json

我在php脚本中解码了一个json数组(见下文)

我可以非常轻松地访问那些未包含在items数组中的值:

[ '顺序'] [ 'shippingOption'] [ 'shippingRate']

[ '顺序'] [ '小计']

但无法弄清楚如何在“items”数组中访问productSku,weight等值。

非常感谢任何帮助。

由于

{

"order":{
"total":245.4,
"shippingOption":{
"shippingRate":5.4,
"shippingMethodId":"15367-1365940349119",
"estimatedTransitTime":"1",
"shippingMethodName":"Courier (Fastway)",
"type":""

},
"ticket":0,
"usdTotal":0,
"paymentParams":{
"map":{
}
},
"paymentStatus":"INCOMPLETE",
"volumeDiscount":0,
"subtotal":240,
"couponDiscount":0,
"tax":0,
"items":[
{
"relatedProducts":{
"productIds":"",
"relatedCategory":{
"enabled":false,
"categoryID":0,
"quantity":1
}
},
"weight":500,
"quantityInStock":0,
"tangible":true,
"ownerId":658087,
"wholesalePrices":{
},
"digital":false,
"id":0,
"fileKeys":[],
"shipping":5.4,
"imageId":94075362,
"productSku":"00247",

0 个答案:

没有答案