How to get multiple selected values of select box in php?

后端 未结 10 2198
既然无缘
既然无缘 2020-11-22 04:18

I have a html form which has a select list box from which you can select multiple values because its multiple property is set to multiple. Consider form method is \'GET\'. T

10条回答
  •  时光取名叫无心
    2020-11-22 04:54

        
    
    Untitled Document
    
    
    
     
     

    You can iterate it directly like this

    foreach ($_GET['select2'] as $value)
        echo $value."\n";
    

    or you can do it like this

    $selectvalue=$_GET['select2'];
    foreach ($selectvalue as $value)
        echo $value."\n"; 
    

提交回复
热议问题