PHP Nested if Statement
Veröffentlicht 2024-05-17 07:47:26
0
4KB
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 »Suche
Kategorien
- Art
- Causes
- Crafts
- Dance
- Drinks
- Film
- Fitness
- Food
- Spiele
- Gardening
- Health
- Startseite
- Literature
- Music
- Networking
- Andere
- Party
- Religion
- Shopping
- Sports
- Theater
- Wellness
Mehr lesen
PHP Syntax
A PHP script is executed on the server, and the plain HTML result is sent back to the browser....
PHP Numbers
In this chapter we will look in depth into Integers, Floats, and Number Strings.
PHP Numbers...
PHP Shorthand if Statements
Short Hand If
To write shorter code, you can write if statements on one line....
PHP echo and print Statements
With PHP, there are two basic ways to get output: echo and print.
In this...
PHP Add Array Items
Add Array Item
To add items to an existing array, you can use the bracket [] syntax....