[英]Pass an array to a PHP page
If I have this in JS: 如果我在JS中有这个:
{
"48_2019-03-12" => {
status: "Open",
date: "2019-03-12",
roomid: 48
},
"48_2019-03-20" => {
status: "Close",
date: "2019-03-20",
roomid: 48
}
}
I created it by using this: 我通过使用以下命令创建的:
var arr = new Map();
arr.set(roomid + '_' + date, {
status: updatedStatus,
date: date,
roomid: roomid
});
What is the best way to pass this to a PHP page ? 将其传递到PHP页面的最佳方法是什么?
Thanks. 谢谢。
您不能将JS直接粘贴到PHP中,它应该通过AJAX请求作为JSON数据发送到PHP服务器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.