Example
Print a string if $a is less than five:
html
<?php
$a = 4;
if($a < 5) {
echo "Less than five";
}
?>
Definition and Usage
The if keyword is used to create an if conditional. The elseif and else keywords can be used to specify code that runs when the condition is not met.
Related Pages
The elseif keyword
The else keyword