Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>you can do if else statements like this:</p> <pre><code>&lt;?php if ($something) { echo 'one conditional line of code'; echo 'another conditional line of code'; } if ($something) echo 'one conditional line of code'; if ($something) echo 'one conditional line of code'; echo 'a NON-conditional line of code'; // this line gets executed regardless of the value of $something ?&gt; </code></pre> <p><br/><br/> and then you can also write if - else in an alternate syntax:</p> <pre><code>&lt;?php if ($something): echo 'one conditional line of code'; echo 'another conditional line of code'; elseif ($somethingElse): echo 'one conditional line of code'; echo 'another conditional line of code'; else: echo 'one conditional line of code'; echo 'another conditional line of code'; endif; ?&gt; </code></pre> <p><br/><br/> with the alternate syntax you can also fall out of parsing mode like this:</p> <pre><code>&lt;?php if ($something): ?&gt; one conditional line of code&lt;br /&gt; another conditional line of code &lt;?php else: echo "it's value was: $value&lt;br /&gt;\n"; ?&gt; another conditional line of code &lt;?php endif; ?&gt; </code></pre> <p>But this gets really messy really fast and I won't recommend it's use (except maybe for template-logic).</p> <p><br/><br/> and to make it complete:</p> <pre><code>&lt;?php $result = $something ? 'something was true' : 'something was false'; echo $result; ?&gt; equals &lt;?php if ($something) { $result = 'something was true'; } else { $result = 'something was false'; } echo $result; ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload