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 關注
- 186 瀏覽
添加回答
舉報