PHP Nested if Statement
نشر بتاريخ 2024-05-17 07:47:26
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 »البحث
الأقسام
- Art
- Causes
- Crafts
- Dance
- Drinks
- Film
- Fitness
- Food
- الألعاب
- Gardening
- Health
- الرئيسية
- Literature
- Music
- Networking
- أخرى
- Party
- Religion
- Shopping
- Sports
- Theater
- Wellness
إقرأ المزيد
PHP Casting
Sometimes you need to change a variable from one data type into another, and sometimes you want a...
PHP Sorting Arrays
The elements in an array can be sorted in alphabetical or numerical order, descending or...
PHP Indexed Arrays
PHP Indexed Arrays
In indexed arrays each item has an index number.
By default, the first item...
PHP switch Statement
The switch statement is used to perform different actions based on different...
PHP Continue
The continue statement can be used to jump out of the current iteration of a loop, and...