Re: greeting based on time
| From: | Bas Jobsen | Date: | Tue, 03 Sep 2002 10:42:30 +0000 |
| Subject: | Re: greeting based on time | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-115015@lists.php.net to get a copy of this message | ||
<?
$hour=date('H');
switch(true)
{
case ($hour< 12): echo 'Good Morning'; break;
case ($hour< 18): echo 'Good Afternoon'; break;
default: echo 'Good Night'; break;
}
?>
Op dinsdag 03 september 2002 13:01, schreef Javier Montserat:
> really simple one -
>
> does someone have a bit of code that will variously display 'good morning',
> 'good afternoon', 'good evening' based on the current time?
>
> good morning from london,
>
> Javier
>
>
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device:
> http://mobile.msn.com