Example
Run some code when a condition is not met:
html
<?php
if (5 < 3) {
echo "Five is less than three";
} else {
echo "Five is not less than three";
}
?>
Definition and Usage
The else keyword specifies a block of code which should run when the condition of an if statement is not met.
Related Pages
The if keyword.
The elseif keyword.