【发布时间】:2010-07-22 15:58:04
【问题描述】:
通过 post 发送一些数据,但想发送一个数组但不断出错?
excludes 是我要发送的数组。
$.post("/youradmin_v2/scripts/php/process.php", {
funcName:'searchContent',
table:'content',
fields:'title,contentID',
keyword:$(this).val(),
tag:'option',
excludes: ['contentType'=>'client','contentType'=>'mainsetion']
},
function(data){
$("#filterContentMenu").html(data);
});
我似乎找不到正确的方法来格式化数组以进行发布?
或澄清我想要的是把它变成一个像
这样的 php 数组$excludes=array('fieldA'=>'client','feildB'=>'mainsetion')
像
一样使用foreach($excludes as $value) {
$toExclude .=" AND ".$value['name']."!='".$value['value']."' ".$value;
}
【问题讨论】:
-
sigh请,请,当您收到错误消息时,请将该错误消息添加到您的帖子中。
-
问题标题应该是“$.post variable...”,因为“$post variable...”在这种情况下可能会被误解。