PHP 5 if...else...elseif Statements

<?php $t = date("H"); if ($t < "20") { echo "Have a good day!"; } else { echo "Have a good night!"; } ?>

1 Response

$t = date('A');

if($t === 'AM') { echo 'It's before noon, i don't know what 20 is representing....'; }

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.