In this article, you will learn about the IF keyword in PHP. The IF keyword in PHP 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.
examples of the IF function
Example 1. In this example, we Print a string if $a is less than five:
<?php
$a = 4;
if($a < 5) {
echo "Less than five";
}
?>