Php 为jquery post获取多个每个值
我有来自jquery的post数据的url。 如何获取Php 为jquery post获取多个每个值,php,jquery,Php,Jquery,我有来自jquery的post数据的url。 如何获取$\u POST['reciver']每值多个 test.php?peygham=&onvan=&startdate=&enddate=&sal=5&nimsal=1&visible=1&pages=1&reciver%5B%5D=687&reciver%5B%5D=695&reciver%5B%5D=690 jquery: $('#to option').pr
$\u POST['reciver']
每值多个
test.php?peygham=&onvan=&startdate=&enddate=&sal=5&nimsal=1&visible=1&pages=1&reciver%5B%5D=687&reciver%5B%5D=695&reciver%5B%5D=690
jquery:
$('#to option').prop('selected',true);
$.post("save.php",{
peygham:$('#peygham').val(),
onvan:$('#onvan').val() ,
startdate:$('#startdateM').val() ,
enddate:$('#enddateM').val(),
sal:$('#sal').val() ,
nimsal:$('#nimsal').val(),
visible:$('#visible').val() ,
pages:$('#pages').val() ,
reciver:$('#to').val() /* => MULTI VALUE */
},
function(data){
$('#message').show();
$('#message').html(data.message);
setTimeout(function() {$('#message').hide();}, 10000);
//window.location = "http://aou.ir/manage/preForm/test.php";
},'json');
});
您可以将其作为数组获取
foreach($_POST['reciver'] as $value){
echo $value;
}
我不明白,$('#to').val()
将获取匹配集中第一个元素的值,因为它是一个ID,所以匹配集中应该只有一个元素。你到底是如何得到多个值的??