Home > Backend Development > PHP Tutorial > 怎么Post一个关联数组给PHP,要求不用jquery

怎么Post一个关联数组给PHP,要求不用jquery

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 10:08:15
Original
943 people have browsed it

如何Post一个关联数组给PHP,要求不用jquery
例如
foo[key1]=value1;
foo[key2]=varlue2;
如何能post给PHP,能从$_POST['foo']将关联数组取出来。
网上查了一下,都是使用juery作的,但我前面用一个Ajax池,只使用了XMLHttpRequest对象实现,
没有使用jquery,如果改用jquery,改动较大,所以问一下不用jquery如何实现这个功能。

------解决方案--------------------
你总是要构造参数串的
foo[key1]=value1&foo[key2]=varlue2&...
------解决方案--------------------

探讨

表单无法传输组的,只能构造字符串
Related labels:
source:php.cn
Statement of this Website
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
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template