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 »Site içinde arama yapın
Kategoriler
- Art
- Causes
- Crafts
- Dance
- Drinks
- Film
- Fitness
- Food
- Oyunlar
- Gardening
- Health
- Home
- Literature
- Music
- Networking
- Other
- Party
- Religion
- Shopping
- Sports
- Theater
- Wellness
Read More
PHP Comments
Comments in PHP
A comment in PHP code is a line that is not executed as a part of the program....
PHP if Operators
Comparison Operators
If statements usually contain conditions that compare two values....
PHP if...else Statements
PHP - The if...else Statement
The if...else statement executes some code if a...
PHP Syntax
A PHP script is executed on the server, and the plain HTML result is sent back to the browser....
PHP Loops
In the following chapters you will learn how to repeat code by using loops in PHP.
PHP Loops...