PHP Nested If

Rashmi Mishra
0

 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:



Post a Comment

0Comments

Post a Comment (0)