Nested If
You can have if statements inside if statements, this is called nested if statements.
Example:
<?php
$a = 13;
if ($a > 10) {
echo "Above 10";
if ($a > 20) {
echo " and also above 20";
} else {
echo " but not above 20";
}
}
?>
Output:
Nested If
You can have if statements inside if statements, this is called nested if statements.
Example:
<?php
$a = 13;
if ($a > 10) {
echo "Above 10";
if ($a > 20) {
echo " and also above 20";
} else {
echo " but not above 20";
}
}
?>
Output:
0Comments