title: PHP Dropdown Validation
body: <p>This is the part of an edit page in PHP
  Here I am displaying the country which is already selected by the user and this code works fine.
  And in this case there are3 countries only. 
  If I have a lot of countries, then I have to validate with each country and the no: of lines of code will increase.
  Is there any other option to acheive this?</p>
  
  <pre><code>Select Country: 
  &lt;select name="country"&gt;
  &lt;?php if($country == "india") { ?&gt;
      &lt;option value=""&gt;-Select Country-&lt;/option&gt;
      &lt;option value="india" selected&gt;india&lt;/option&gt;
      &lt;option value="us"&gt;us&lt;/option&gt;
      &lt;option value="uk"&gt;uk&lt;/option&gt;
  &lt;?php } else if($country == "us"){ ?&gt;
      &lt;option value=""&gt;-Select Country-&lt;/option&gt;
      &lt;option value="india"&gt;india&lt;/option&gt;
      &lt;option value="us" selected&gt;us&lt;/option&gt;
      &lt;option value="uk"&gt;uk&lt;/option&gt;
  &lt;?php } else{ ?&gt;
      &lt;option value=""&gt;-Select Country-&lt;/option&gt;
      &lt;option value="india"&gt;india&lt;/option&gt;
      &lt;option value="us"&gt;us&lt;/option&gt;
      &lt;option value="uk" selected&gt;uk&lt;/option&gt;
  &lt;?php } ?&gt;
  &lt;/select&gt;
  </code></pre>