title: Converting a nested if-else based on range condition into switch statement
body: <p>How can I convert following long if-else condition into switch case in PHP? Or, please suggest any feasible solution besides switch case.</p>
  
  <pre class="lang-php prettyprint-override"><code>if($total_products &gt;= 1 &amp;&amp; $total_products &lt;=10 ){
  
  } elseif ($total_products &gt;= 11 &amp;&amp; $total_products &lt;=25 ){
  
  } elseif ($total_products &gt;= 26 &amp;&amp; $total_products &lt;=40 ){
  
  } elseif ($total_products &gt;= 181 &amp;&amp; $total_products &lt;=200 ){
  
  } elseif ($total_products &gt;= 351 &amp;&amp; $total_products &lt;=400 ){
  
  } elseif ($total_products &gt;= 401 &amp;&amp; $total_products &lt;=500 ){
  
  } elseif ($total_products &gt; 500 ){
  
  }
  </code></pre>