How to Get the multiple radio buttons values in PHP which having names dynamically

前端 未结 4 2233
不思量自难忘°
不思量自难忘° 2021-02-09 06:17

I am having following codings in my form..how do I get the value of all radio button values on submit which is inside looping? Or give me any other solution for this.



        
4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-09 06:56

    Yes, as Sean commented, try this:

    Questions?

    and then use the below in PHP side to get radio button value as :

    foreach ($_POST['optradio'] as $optNum => $option) {
        // do stuff with $optNum and $option
    }
    

提交回复
热议问题