How to use $_GET to get multiple parameters using the same name in PHP

后端 未结 4 1317
长发绾君心
长发绾君心 2021-01-20 04:23

I\'m using checkboxes to search a mysql database I have created. As the checkboxes all use the same name, when I use $_GET, it only gets the last value in the URL.

4条回答
  •  情书的邮戳
    2021-01-20 04:34

    I have never tried it with $_GET, but if you use $_POST you can do something like this:

     Honda
     Ford
     Toyota
    // note the [] in the name
    

    so that $car = $_POST['car'] is an array

    You can try it with $_GET as well and see.

提交回复
热议问题