title: Multiselect drop down
body: <p>I have a PHP question. I am trying to alter some code that a partner of mine wrote (he has since then left and cannot be contacted) but I am not hugely familiar with PHP. I believe that the question will be fairly simple but I am not sure where to start. Currently there is a drop down menu that allows you to select only one option. I BELIEVE the code that is involved in that process is here: </p>
  
  <pre><code>&lt;select id='List' style='width:75px' onchange='displayEx(this);'&gt;
      &lt;option value="0"&gt;list&lt;/option&gt;
  
      &lt;?php
      foreach ($LIST as $list)
      {
          echo "&lt;option value='$list'&gt;$list&lt;/option&gt;";
      }
      echo "&lt;/select&gt;";
      ?&gt;   
  &lt;select id='selectd' style='width:75px'&gt;
          &lt;option value="0"&gt;X&lt;/option&gt;
          &lt;/select&gt;
          &lt;input id="addTest" type="button" value="Add" onclick="addTest();"/&gt;
          &lt;p id='error_display' style="height:10px;"&gt;&lt;/p&gt;
          &lt;div&gt;
              &lt;?php
                  $i = 1;
                  foreach ($Groups as $G)
                  {
                  echo "&lt;div style='float:left;width:30%;height:100px;display:inline'&gt;&lt;p id='Group $i' title='$G'&gt;Group $G:&lt;/p&gt;&lt;p id='display_Group_$i'&gt;0/94&lt;/p&gt;&lt;input id=\"get_Group_$i\" type=\"button\" value=\"Create\" onclick=\"createSheet($i);\" disabled = \"true\" style=\" vertical-align:bottom; display:inline;\"/&gt;&lt;/div&gt;";
                  $i++;
                  }
              ?&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>But I am not sure what to do with it. I was thinking something like this...</p>
  
  <pre><code>foreach ($select as $value)  
  {  
      echo '&lt;option';  
      if (isset($_POST['select']) &amp;&amp; $_POST['select'] == $value)  
      SOMETHING HERE
  }  
  </code></pre>
  
  <p>I don't know though. Other peoples code can sometimes be so confusing (particularly in a language you aren't the best at). For my sanity I hope someone can help me puzzle this out but even if someone could help me translate the current code I would be super grateful. </p>