如何将javascript数组传递给php文件 [英] How to pass a javascript array to php file

查看:78
本文介绍了如何将javascript数组传递给php文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


展开 | 选择 | Wrap | 行号

推荐答案

我猜你必须使用序列化器。 JSON和WDDX是我听说过的(都在Javascript和PHP中工作)


在javascript代码行16中是不必要的,你的数组(y)将被替换为返回字符串(responseText)。
I guess you have to use a serializer for that. JSON and WDDX are the ones I''ve heard of (both work in Javascript and PHP)

in the javascript code line 16 is unnecessary, your array (y) will be replaced by the return string (responseText).


ok ...你能给出一个如何序列化它的例子吗?
ok...can you just give an example of how to serialize it??


到目前为止我'只做了WDDX。 JSON可能更适合您。您可以在此处找到解释和示例:
so far I''ve only done WDDX. JSON might be more suitable for you. explanations and example you can find here:
  • PHP: JSON - Manual
  • JSON ? MDC (Javascript)


这篇关于如何将javascript数组传递给php文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆