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

前端 未结 4 2239
不思量自难忘°
不思量自难忘° 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 07:21

    take a one hidden input for storing radio button name array in for loop like

    
    

    and then fetch radio button value using foreach

    $rdobtn = $_POST['testradio'];
    $idx = 0;
    
        foreach($rdobtn as $val){
    
          $rdovalue = $val[$idx];
    
          // perform opertation using above $rdovalue variable.
    
           $idx++;
        }
    

    }

提交回复
热议问题