php - 多维 JavaScript 数组到 PHP 数组

标签 php javascript arrays multidimensional-array

我已经尝试解决这个问题有一段时间了。我在 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/

相关文章:

php - 添加图片上传到html页面(mysql后端)

php - 将xml数据导入mysql,如何管理对文件的修改

php - 通过查询导出 MySql 表,选择几行按降序排列

javascript - HTML5 视频 - 在最后一帧暂停

javascript - R Shiny从异步调用javascript获取IP地址返回

javascript - 在 React 中为 div 列表设置动画

php - PHP 变量函数在 PHP4 中工作吗?

java - 允许数组中的线程不安全

javascript - 将数据从一张纸过滤到另一张纸

arrays - Mongodb 如何删除/清除另一个数组中的数组