title: Elegant way to add "selected" into a dropdrown form using PHP
body: <p>I have a form that looks like this:</p>
  
  <pre><code>$guests = 2; // Just for testing
  $form = 'Guests&lt;br /&gt;&lt;select name="guests"&gt;
               &lt;option value="0"&gt;0&lt;/option&gt;
               &lt;option value="1"&gt;1&lt;/option&gt;
               &lt;option value="2"&gt;2&lt;/option&gt;
               &lt;option value="3"&gt;3&lt;/option&gt;
               &lt;option value="4"&gt;4&lt;/option&gt;
               &lt;option value="5"&gt;5&lt;/option&gt;
               &lt;option value="6"&gt;6&lt;/option&gt;
               &lt;option value="7"&gt;7&lt;/option&gt;
               &lt;option value="8"&gt;8&lt;/option&gt;
               &lt;option value="9"&gt;9&lt;/option&gt;
               &lt;/select&gt;';
  </code></pre>
  
  <p>But the list of guests can be up to 100, so I probably shouldn't do a check for which value is selected manually.</p>
  
  <p>What would be a good way for me to make the selected value become the selected value when the user sees this form?</p>
  
  <p>Thanks!</p>