我将以下 jquery 发布到 php 页面。var_dump($_POST);
php 页面上的A返回 null 但如果我这样做:
$.post("test.php", {"script" : script} );
一切正常。
我不想那样做的原因是数组可以有可变参数。有什么帮助吗?
var arr = new Array();
arr["script"] = scrip;
arr["account"] = "max@hotmail.com";
arr["accounttag"] = "TH";
if (follow != "")
arr["followtag"] = follow;
if (join != null)
arr["join"] = join;
$.post("test.php", arr );
//{"script" : script, "account" : "max@hotmail.com", "accounttag" : "TH"}
//works if used instead of arr
///test.php
var_dump($_POST)
array 0{null};