Count Similar Array Keys

前端 未结 4 1620
花落未央
花落未央 2021-01-13 18:43

I have a POST request coming to one of my pages, here is a small segment:

[shipCountry] => United States
[status] => Accepted
[sku1] => test
[produc         


        
4条回答
  •  情深已故
    2021-01-13 18:51

    What Gumbo meant with his "use array instead" comment is the following:

    In your HTML-form use this:

    
    

    and $_POST['quantity'] will then be an array of all containing all of your quantities.

    If you need to supply an id you can also do this:

    
    

    $_POST['quantity][0] will then hold the corresponding quantity.

提交回复
热议问题