title: PHP nested ternary if condition
body: <pre><code>&lt;?php
  $var = 4;
  echo $current = ($var &gt; 2) ? "gr than 2" : ($var &gt; 6) ? "gr than 6" : "not gr than 2 or 6";
  ?&gt;
  </code></pre>
  
  <p>for the above code, it always returns - gr than 6. Can someone please suggest what did I wrong?</p>