How to pass multi-dimensional array with Jquery AJAX post?

前端 未结 6 1135
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-31 17:17

I\'ve been using Serialize() to pass checkbox form data with Post() for a basket that can hold multiple items of the same category.

When I post them using the submit

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-31 17:53

    $.ajax({
        type:   'post',
        cache:  false,
        url:    './ajax.php',
        data:   { arrayData }
    });
    

    You must use {} to contain the { arrayData } variable.

    then echo $_POST[arrayData]; will yield Array. If not, it will not send array value.

提交回复
热议问题