PHP else Keyword

P
PHP elseif Keyword
PHP echo Keyword

In this article, you will learn about the else keyword in PHP. The else keyword in PHP specifies a block of code that should run when the condition of an if statement is not met.

examples of the ELSE keyword

Example 1. In this example, we run some code when a condition is not met.

<?php
if (5 < 3) {
  echo "Five is less than three";
} else {
  echo "Five is not less than three";
}
?>
PHP elseif Keyword
PHP echo Keyword

Tutor Network

Share this

Learn PHP from A to Z