Home | Insert New Record | Login | Logout | |
FAQ
NEWS
FEEDBACK
HTML CSS PHP SQL
PHP if, else and elseif Statements
Welcome !
PHP if, else and elseif Statements

PHP Conditional Statements

Very often when you write code, you want to perform different actions for different conditions. You can use conditional statements in your code to do this.

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!";
}
?>

Users replays
0 results
- Add your answer -