PHP Nested if Statement

0
4KB

Nested If

You can have if statements inside if statements, this is called nested if statements.

ExampleGet your own PHP Server

An if inside an if:

$a = 13;

if ($a > 10) {
  echo "Above 10";
  if ($a > 20) {
    echo " and also above 20";
  } else {
    echo " but not above 20";
  }
}
Try it Yourself »
Rechercher
Catégories
Lire la suite
Autre
PHP Variables Scope
PHP Variables Scope In PHP, variables can be declared anywhere in the script. The scope of a...
Par PHP Tutorial 2024-05-17 07:18:52 0 10KB
Autre
PHP Loops
In the following chapters you will learn how to repeat code by using loops in PHP. PHP Loops...
Par PHP Tutorial 2024-05-17 07:48:35 0 4KB
Autre
PHP Global Variables - Superglobals
Superglobals were introduced in PHP 4.1.0, and are built-in variables that are always available...
Par PHP Tutorial 2024-05-17 08:08:10 0 10KB
Autre
PHP Indexed Arrays
PHP Indexed Arrays In indexed arrays each item has an index number. By default, the first item...
Par PHP Tutorial 2024-05-17 08:00:38 0 5KB
Autre
تطورات التعلم الآلي وتأثيرها على مستقبل العمل
مقدمة: في ظل التطورات السريعة للتكنولوجيا والابتكار، أصبح التعلم الآلي...
Par MOHAMED ATTALLAH 2024-05-14 13:56:58 0 7KB
Sociallez https://sociallez.com