 <p>Optimized</p> <pre><code>if ($buyoption != 'With Validation' &amp;&amp; $buyoption != "No Validation") { $buyoptionError = "Please select a buy option"; echo "$buyoptionError &lt;br&gt;"; $YesorNo = 0; } </code></pre>