PHP Example
Screen shot
selecting multiple values from a dropdownlist

<?php
if(isset($_POST['btn'])){
 if(isset($_REQUEST['menu'])){
  $menu=$_REQUEST['menu'];
   foreach($menu as $key=>$value){
      if(is_array($value)){
          foreach($value as $item){
              echo $item."<br>";
          }
      }
             
      else{
         echo $value."<br>";
       }
    }
  }
  else{
     echo "please select any option";
  }
 }
?>
     <html>
     <head>
     <title>PHP Example</title><br>
     <body>
    <form name="frm" action="multiple_dropdown.php" method="post">
    <b>Select your favorite ice_cream flavour(s)</b><br>
     <select name="menu[]" multiple>
     <option value="ice cream">ice cream</option>
     <option value="coffee">coffee</option>
     <option value="tea">tea</option>
     <option value="beverage">beverage</option>
     <option value="cold coffee">cold coffee</option>
     </select><br>
     <input type="submit" name="btn" value="submit" />
     </form>
     </body>
     </html>

You can download source code here