PHP Nested if Statement

0
4χλμ.

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 »
Αναζήτηση
Κατηγορίες
Διαβάζω περισσότερα
άλλο
PHP Data Types
PHP Data Types Variables can store data of different types, and different data types can do...
από PHP Tutorial 2024-05-17 07:27:24 0 5χλμ.
άλλο
PHP Continue
The continue statement can be used to jump out of the current iteration of a loop, and...
από PHP Tutorial 2024-05-17 07:52:32 0 4χλμ.
άλλο
الثورة البلوكتشين وتحولاتها في الصناعات المختلفة
مقدمة: شهدت تقنية البلوكتشين ثورة هائلة في السنوات الأخيرة، حيث أصبحت لديها القدرة على تغيير...
από MOHAMED ATTALLAH 2024-05-14 14:03:03 0 7χλμ.
άλλο
PHP - Modify Strings
PHP has a set of built-in functions that you can use to modify strings. Upper Case...
από PHP Tutorial 2024-05-17 07:29:19 0 8χλμ.
άλλο
PHP Multiline Comments
Multi-line Comments Multi-line comments start with /* and end with */. Any text...
από PHP Tutorial 2024-05-17 07:15:48 0 6χλμ.
Sociallez https://sociallez.com