PHP Nested if Statement
Posted 2024-05-17 07:47:26
0
2K
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 Delete Array Items
Remove Array Item
To remove an existing item from an array, you can use...
PHP for Loop
The for loop - Loops through a block of code a specified number of times.
The PHP...
PHP Continue
The continue statement can be used to jump out of the current iteration of a loop, and...
PHP Access Arrays
Access Array Item
To access an array item, you can refer to the index number for indexed arrays,...
PHP Array Functions
PHP Array Functions
PHP has a set of built-in functions that you can use on arrays....