html select option SELECTED <p>I have in my php</p> <pre><code>$sel = " &lt;option&gt; one &lt;/option&gt; &lt;option&gt; two &lt;/option&gt; &lt;option&gt; thre &lt;/option&gt; &lt;option&gt; four &lt;/option&gt; "; </code></pre> <p>let say I have an inline URL = <code>site.php?sel=one</code></p> <p>if I didn't saved those options in a variable, I can do it this way to make one of the option be SELECTED where value is equal to <code>$_GET[sel]</code></p> <pre><code>&lt;option &lt;?php if($_GET[sel] == 'one') echo"selected"; ?&gt; &gt; one &lt;/option&gt; &lt;option &lt;?php if($_GET[sel] == 'two') echo"selected"; ?&gt; &gt; two &lt;/option&gt; &lt;option &lt;?php if($_GET[sel] == 'three') echo"selected"; ?&gt; &gt; three &lt;/option&gt; &lt;option &lt;?php if($_GET[sel] == 'four') echo"selected"; ?&gt; &gt; four &lt;/option&gt; </code></pre> <p>but the problem is, I need to save those options in a variable because I have a lot of options and I need to call that variable many times.</p> <p>Is there a way to make that option be selected where <code>value = $_GET[sel]</code> ?</p>