$_POST Array from html form

前端 未结 4 699
悲&欢浪女
悲&欢浪女 2020-11-28 12:46

I am trying to send data from multiple checkboxes (id[]) and create an array \"info\" in php to allow me to run a script for each value (however the quantity of values may c

4条回答
  •  攒了一身酷
    2020-11-28 13:26

    Change

    $info=$_POST['id[]'];
    

    to

    $info=$_POST['id'];
    

    by adding [] to the end of your form field names, PHP will automatically convert these variables into arrays.

提交回复
热议问题