我已经尝试解决这个问题有一段时间了。我在 JavaScript 中有一个多维数组,宽度为 12 列,行数未知,如下所示
/*
[
[userID (int), name, username, email, password, other 1, other 2, other 3, other 4, other 5, other 6, admin(int)],
[userID (int), name, username, email, password, other 1, other 2, other 3, other 4, other 5, other 6, admin(int)],
[userID (int), name, username, email, password, other 1, other 2, other 3, other 4, other 5, other 6, admin(int)],
...
]
*/
除 (int) 值外,所有值都是字符串。这是我网站的实时用户编辑页面。我现在已经制作了 JavaScript 数组,我需要它,因此当按下“提交”按钮时,它将像这样格式化的数组转换为 PHP 数组并将其保存为变量。我可以获得帮助吗?
最佳答案
Encode to JSON , post通过 Ajax 转至 PHP或regular Form并在服务器端使用 json_decode 进行解码
关于php - 多维 JavaScript 数组到 PHP 数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2280723/