PHP Nested if Statement
Postado 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 »Pesquisar
Categorias
- Art
- Causes
- Crafts
- Dance
- Drinks
- Film
- Fitness
- Food
- Jogos
- Gardening
- Health
- Início
- Literature
- Music
- Networking
- Outro
- Party
- Religion
- Shopping
- Sports
- Theater
- Wellness
Leia Mais
PHP Variables Scope
PHP Variables Scope
In PHP, variables can be declared anywhere in the script.
The scope of a...
PHP - Modify Strings
PHP has a set of built-in functions that you can use to modify strings.
Upper Case...
PHP Operators
PHP Operators
Operators are used to perform operations on variables and values.
PHP divides the...
PHP Casting
Sometimes you need to change a variable from one data type into another, and sometimes you want a...
PHP Functions
The real power of PHP comes from its functions.
PHP has more than 1000 built-in functions, and...