PHP if Keyword

PHP Keywords : Print a string if $a is 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

Read more about conditionals in our PHP Conditionals Tutorial.

❮ PHP Keywords