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 »Cerca
Categorie
- Art
- Causes
- Crafts
- Dance
- Drinks
- Film
- Fitness
- Food
- Giochi
- Gardening
- Health
- Home
- Literature
- Music
- Networking
- Altre informazioni
- Party
- Religion
- Shopping
- Sports
- Theater
- Wellness
Leggi tutto
PHP switch Statement
The switch statement is used to perform different actions based on different...
PHP Comments
Comments in PHP
A comment in PHP code is a line that is not executed as a part of the program....
PHP Syntax
A PHP script is executed on the server, and the plain HTML result is sent back to the browser....
PHP Casting
Sometimes you need to change a variable from one data type into another, and sometimes you want a...
PHP do while Loop
The do...while loop - Loops through a block of code once, and then repeats the loop as...