2 回答
TA贡献1817条经验 获得超6个赞
“Product_Name”附近的 json 语法有错误。
值必须是字符串,因此在 "" 之间。
如果您有解决问题,请告诉我们:)
祝你有美好的一天 !
TA贡献1834条经验 获得超8个赞
解决方案
使用json_decode($jsondata, true)来代替。
详细解释:json_decode
要使用的正确 JSON
您的 json-string 中也有错误
这是要使用的正确 json:
{
"data": [{
"Contact_Name": {
"id": "1884053000034678068"
},
"Subject": "1 - XKBKNABJK",
"Status": "Sans Impact Stock",
"Entity": "",
"Etat": "CM - Annul\u00e9",
"Invoice_Date": "2017-11-21",
"Discount": 0.000000,
"Tax": ["TVA"],
"Total_HT": "55.000000",
"Total_TVA": 0,
"Methode_de_paiement": "Payment by check",
"ID_Lip": "1",
"Origine": "CM",
"Type_de_Facture": "Solde",
"Transporteur": "My carrier",
"Reference_Colis": "",
"Billing_Street": "16, Main street",
"Compl_ment_Facturation": "2nd floor",
"Billing_City": "Miami",
"Billing_Country": "\u00c9tats-Unis",
"Billing_Code": "33133",
"Shipping_Street": "16, Main street",
"Compl_ment_Livraison": "2nd floor",
"Shipping_City": "Miami",
"Shipping_Country": "\u00c9tats-Unis",
"Shipping_Code": "33133",
"Product_Details": [{
"product": {
"id": "1884053000030235273"
},
"Product_Name": "Blouse - Color: White, Size: M",
"list_price": 22.5,
"quantity": 1,
"Discount": 0,
"Discount_Amount": 0,
"line_tax": [{
"percentage": 20,
"name": "TVA"
}]
}, {
"product": {
"id": "1884053000030235273"
},
"Product_Name": "Printed Dress - Color: Orange, Size: S",
"list_price": 21.67,
"quantity": 1,
"Discount": 0,
"Discount_Amount": 0,
"line_tax": [{
"percentage": 20,
"name": "TVA"
}]
}, {
"product": {
"id": "1884053000012868763"
},
"list_price": 1.67,
"quantity": 1,
"Discount": 0,
"Discount_Amount": 0,
"line_tax": [{
"percentage": 20,
"name": "TVA"
}]
}],
"Adjustment": 0,
"Montant_TPH": 0,
"TVA_sur_DEEE_TPH": "0",
"Taxes_DEEE_TPH": "TPH",
"Frais_de_port_HT": "2.000000",
"Frais_de_port_TTC": "2.000000",
"Nb_produits": 3,
"Quantite_totale": 3
}],
"duplicate_check_fields": ["ID_Lip"],
"trigger": []
}
为将来
在此处检查您的 json以获得安全结果。
我希望这有帮助
- 2 回答
- 0 关注
- 168 浏览
添加回答
举报