Retrieve post array values

后端 未结 6 1076
野的像风
野的像风 2021-01-13 01:23

I have a form that sends all the data with jQuery .serialize() In the form are four arrays qty[], etc it send the form data to a sendMail page and

6条回答
  •  旧巷少年郎
    2021-01-13 01:41

    php automatically detects $_POST and $_GET-arrays so you can juse:

    and $qty will by a php-Array. Now you can access it by:

    if (is_array($qty))
    {
      for ($i=0;$i
    

    if you are not sure about the format of the received data structure you can use:

    print_r($_POST['qty']);
    

    or even

    print_r($_POST);
    

    to see how it is stored.

提交回复
热议问题