var send = Ti.Network.createHTTPClient({
onerror : function(e) {
Ti.API.debug(e.error);
alert('There was an error during the connection');
},
});
send.open('POST', 'abc.php');
var data = Ti.App.Properties.getList('cart');
//data containing js array object:
i.e:[{"key":"5736","quantity":"1","product_name":"Fruit Raita","price":"75.00"},{"key":"11454","quantity":"2","product_name":"Veg. Harabhara Kabab","price":"90.00"}]
send.send({
products:JSON.stringify(data),
});
//现在如何在php中检索这个数组?
我试过以下事情:
1)json_decode($_POST['products']);
2)var_dump
3)json_decode(stripslashes($_POST['products']));
我怎么能在php中使用这个数组?