Home  >  Article  >  Backend Development  >  jQuery和PHP的JSON交互,如何避免二维数组

jQuery和PHP的JSON交互,如何避免二维数组

WBOY
WBOYOriginal
2016-06-13 13:35:34955browse

jQuery和PHP的JSON交互,如何处理二维数组?
从浏览器端的jqGrid中取得的数据是一个二维数组,如何传到服务器端,再用PHP处理?

------解决方案--------------------
php端用json_decode解码即可
------解决方案--------------------

转换成json串,post到服务器,再用 json_decode解码成数组
------解决方案--------------------
jquery.json 插件.

把jqGrid 数组处理成 json 串后.

发送到服务器

服务器接收(注意可能引号会转义)后, json_decode 即可. 加上 第二个参数.可以把数据强制转化为 PHP 数组.
------解决方案--------------------

探讨
从浏览器端的jqGrid中取得的数据是一个二维数组,如何传到服务器端,再用PHP处理?
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn