Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 为jquery post获取多个每个值_Php_Jquery - Fatal编程技术网

Php 为jquery post获取多个每个值

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

我有来自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').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,所以匹配集中应该只有一个元素。你到底是如何得到多个值的??