Here is the JSON which is sent asynchronously to my php page. It is essentially a product list, which will be inserted into my mySQL database.
My issue is decoding the JSON in PHP. I can do this fine in js with the 'eval' function, but in PHP my efforts have resulted in a complicated series of explode and implode functions.
{
"Product": [
{
"Product_Title": "Cloth",
"Product_Description": "Here is cloth",
"Price": "100",
"Category_ID": "1"
},
{
"Product_Title": "Cloth",
"Product_Description": "Here is cloth",
"Price": "100",
"Category_ID": "1"
},
{
"Product_Title": "Cloth",
"Product_Description": "Here is cloth",
"Price": "100",
"Category_ID": "1"
}
]
}
I know php has a built in json_decode function, but in the PHP documentation they only show how to handle an array.
Any advice or help is really appreciated
Taylor
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…