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 Multidimensional Arrays
In the previous pages, we have described arrays that are a single list of key/value pairs....
PHP switch Statement
The switch statement is used to perform different actions based on different...
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 Constants
Constants are like variables, except that once they are defined they cannot be changed or...