PHP - The if Statement


PHP - The if Statement
The if statement executes some code if one condition is true.

Syntax
if (condition) {
    code to be executed if condition is true;
}

Example:

<!DOCTYPE html>
<html>
<body>

<?php
$t = date("H");

if ($t < "20") {
    echo "Have a wonderful day!";
}
?>

</body>
</html>

Comments