IF... Statement

The if syntax in PHP is exactly the same as that in html. Just like in html, you can have nested if statements, and if-else statements. You can only check multiple conditions inside an if statement by using the "or" operator (||) and the "and" operator (&&). For example:

$age = 14;
$name = "Asha";

if($age >= 18 && $name = "Asha"){

echo "Welcome, Asha!";

} else {

echo ("Access denied. Either you're not Asha, or you're not over 18. Sorry! ");

};


Access denied. Either you're not Asha, or you're not over 18. Sorry!