PHP - The if Statement

The if statement is used to execute some code only if a specified condition is true.

Syntax

if (condition) {
    code to be executed if condition is true
;
}
The example below will output "Have a good day!" if the current time (HOUR) is less than 20:

Example


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

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

No comments:

| Designed by Harhiktech