JSON序列化的二维数组,送两个数组,还是其他? [英] Serialize json 2-dimensional array, send two arrays, or other?
本文介绍了JSON序列化的二维数组,送两个数组,还是其他?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在使用发一个二维数组(和其他一些变量)到PHP jQuery.ajax()
。我相信我的选择是:
I have to send a 2-dimensional array (along with several other variables) to PHP using jQuery.ajax()
. I believe my options are:
- 在序列化到JSON与 JSON-JS
- 发送两个数组为CSV字符串和重新编译的另一面。
我的问题是:
一个。这有什么错选项#2如果我preFER不包括其他图书馆的一个小功能? B.是否有其他的选择,除了选择#1和#2?
A. Is there anything wrong with option #2 if I'd prefer not to include another library for a small function? B. Are there other options besides options #1 and #2?
谢谢!
推荐答案
您可以试试:
JSON.stringify(array);
无需额外的库。
No extra library required.
这篇关于JSON序列化的二维数组,送两个数组,还是其他?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文