PHP elseif Keyword

PHP empty Keyword
PHP else Keyword

In this article, you will learn about elseif keyword in PHP. The elseif keyword in PHP tests a new condition if the condition of a previous if or elseif statement was not met. It is equivalent to putting an if statement inside an else block.

examples of the ELSEIF keyword

Example 1. In this example, we test a second condition if the first condition is not met.

<?php
if(5 < 3) {
  echo "Five is less than three";
} else if(5 > 4) {
  echo "Five is greater than four";
}
?>
PHP empty Keyword
PHP else Keyword

Stay up-to-date about PHP!

We don’t spam!

en English
X
Scroll to Top