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 if...else Statements
PHP - The if...else Statement The if...else statement executes some code if a...
بواسطة PHP Tutorial 2024-05-17 07:46:12 0 4كيلو بايت
أخرى
تطورات التعلم الآلي وتأثيرها على مستقبل العمل
مقدمة: في ظل التطورات السريعة للتكنولوجيا والابتكار، أصبح التعلم الآلي...
بواسطة MOHAMED ATTALLAH 2024-05-14 13:56:58 0 7كيلو بايت
أخرى
PHP Installation
What Do I Need? To start using PHP, you can: Find a web host with PHP and MySQL support...
بواسطة PHP Tutorial 2024-05-17 07:09:40 0 5كيلو بايت
أخرى
PHP Casting
Sometimes you need to change a variable from one data type into another, and sometimes you want a...
بواسطة PHP Tutorial 2024-05-17 07:38:02 0 4كيلو بايت
أخرى
PHP Break
The break statement can be used to jump out of different kind of loops. Break in For...
بواسطة PHP Tutorial 2024-05-17 07:50:37 0 5كيلو بايت
Sociallez https://sociallez.com