0

我有这个 url 用于从 jquery 发布数据。如何获取$_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');
});
4

1 回答 1

0

你可以把它作为数组

foreach($_POST['reciver'] as $value){
  echo $value;
}
于 2012-12-15T08:21:28.873 回答