PHP Nested if Statement

0
4K

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 »
Search
Categories
Read More
Other
PHP Introduction
PHP code is executed on the server. What You Should Already Know Before you continue you...
By PHP Tutorial 2024-05-17 07:08:40 0 4K
Other
PHP Variables
Variables are "containers" for storing information. Creating (Declaring) PHP Variables In...
By PHP Tutorial 2024-05-17 07:16:59 0 7K
Other
تطورات التعلم الآلي وتأثيرها على مستقبل العمل
مقدمة: في ظل التطورات السريعة للتكنولوجيا والابتكار، أصبح التعلم الآلي...
By MOHAMED ATTALLAH 2024-05-14 13:56:58 0 7K
Other
PHP Casting
Sometimes you need to change a variable from one data type into another, and sometimes you want a...
By PHP Tutorial 2024-05-17 07:38:02 0 4K
Other
PHP Constants
Constants are like variables, except that once they are defined they cannot be changed or...
By PHP Tutorial 2024-05-17 07:39:53 0 8K
Sociallez https://sociallez.com