PHP Nested if Statement

0
4Кб

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 »
Поиск
Категории
Больше
Другое
PHP Data Types
PHP Data Types Variables can store data of different types, and different data types can do...
От PHP Tutorial 2024-05-17 07:27:24 0 5Кб
Другое
PHP - Escape Characters
Escape Character To insert characters that are illegal in a string, use an escape character. An...
От PHP Tutorial 2024-05-17 07:32:36 0 11Кб
Другое
PHP - Concatenate Strings
String Concatenation To concatenate, or combine, two strings you can use...
От PHP Tutorial 2024-05-17 07:30:24 0 9Кб
Другое
PHP Nested if Statement
Nested If You can have if statements inside if statements, this is...
От PHP Tutorial 2024-05-17 07:47:26 0 4Кб
Другое
PHP Update Array Items
Update Array Item To update an existing array item, you can refer to the index number for...
От PHP Tutorial 2024-05-17 08:02:49 0 7Кб
Sociallez https://sociallez.com