PHP Nested if Statement
Posted 2024-05-17 07:47:26
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 »Căutare
Categorii
- Art
- Causes
- Crafts
- Dance
- Drinks
- Film
- Fitness
- Food
- Jocuri
- Gardening
- Health
- Home
- Literature
- Music
- Networking
- Alte
- Party
- Religion
- Shopping
- Sports
- Theater
- Wellness
Citeste mai mult
PHP while Loop
The while loop - Loops through a block of code as long as the specified condition is...
PHP if...else Statements
PHP - The if...else Statement
The if...else statement executes some code if a...
PHP Sorting Arrays
The elements in an array can be sorted in alphabetical or numerical order, descending or...
PHP foreach Loop
The foreach loop - Loops through a block of code for each element in an array or each...
PHP Break
The break statement can be used to jump out of different kind of loops.
Break in For...