Control flow / Conditional statements / if/else statements
Valid example
Valid example
Invalid example
Complex conditions
Ternary operator
<?php
$n =
-42
;
$classify = ($n >
0
) ?
"positive"
:
"negative"
;
//classify is "negative"
echo $classify;