title: Is having multiple pre-selected values in <select multiple> possible?
body: <p>Is it possible to have multiple pre-selected options in a  box? Below is my PHP code which makes logical sense to me and appears to output the correct HTML with everything in the right place, but it doesn't actually display with any options selected on the page.</p>
  
  <pre><code>&lt;?php
  
  $options = $wpdb-&gt;get_results( $query); 
  $number = count($options);
  
  $optionsChosen = explode(",", $userInfo-&gt;userOptions); 
  // This is the list of options the user has chosen, separated by commas, i.e. "service1, service2,"
  
  echo "&lt;select name=\"option[]\" id=\"option\" size=\"$number\" multiple&gt;\n";
  
  foreach ( $options as $thisOption ) { 
      echo "&lt;option value=\"$thisOption-&gt;optionName\" title=\"";
      echo stripslashes($thisOption-&gt;optionDescription)."\" ";
  
      for($i=0; $i&lt;count($optionsChosen); $i++){
          if($optionsChosen[$i]==$thisOption-&gt;optionName){
              echo "selected=\"selected\" ";
          } // End if()
      } // end for()
  
      echo "&gt;$thisOption-&gt;optionName&lt;/option&gt;\n";
   } // end foreach()
   ?&gt;
   &lt;/select&gt;
  </code></pre>
  
  <p>This is my PHP, and the HTML it's outputting looks fine and includes the selected="selected" in the right place for the appropriate values, but for whatever reason they aren't actually selected. Is this just not a possible thing in HTML? This works fine for me if I only have one possible selection, but I can't seem to find anywhere online mentioning that its only supported for single  tags. If this isn't possible, is there a way to achieve something similar?</p>
  
  <p>Edit: As everybody says, it works fine. For whatever reason, refreshing the page (which was built using get variables) in Firefox would refresh the source code but not what was shown inside the browser, closing the page and re-opening it made it work as predicted.</p>