title: Changing HTML Checkbox list into select dropdown list with PHP
body: <p>I am trying to create a html/php form that allows an array of data to be displayed in a drop/selection menu. How would i turn this into one?</p>
  
  <pre><code>&lt;?php
  
  $OptionID   =   1;
  
  foreach( $this-&gt;setRoleOptions as $RoleID =&gt; $RoleName ) :
  
      echo '&lt;div align="center"&gt;';
      echo '&lt;input type="checkbox" style="width: 30px;" name="RoleID" value="'. $RoleID .'" ';
  
      if ( $OptionID == 1 ) :
  
          echo ' CHECKED ';
  
      endif;
  
      echo '/&gt;&amp;nbsp;'. $RoleName;
      echo '&lt;/div&gt;';
  
      ++$OptionID; 
  
  endforeach;
  
  ?&gt;
  </code></pre>
  
  <p>I have tried the below code which gets the array but once the option is selected, nothing happens. </p>
  
  <pre><code>&lt;?php
  $OptionID = array("Administrative", "Operations 1", "Operations 2");
  ?&gt;
  
  &lt;select&gt;
      &lt;?php foreach ($this-&gt;setRoleOptions as $RoleID =&gt; $RoleName): ?&gt;
      &lt;option name="RoleID" value="&lt;?php echo $RoleID; ?&gt;"&lt;?php if ($row['RoleID'] == $OptionID): ?&gt; selected="selected"&lt;?php endif; ?&gt;&gt;
          &lt;?php echo $RoleName;?&gt;
      &lt;/option&gt;
      &lt;?php endforeach; ?&gt;
  &lt;/select&gt;
  </code></pre>