Jump to content

change text depending on time of day.


mr_badger

Recommended Posts

date("H") will generate the hour (24-hr format).

 

http://ca3.php.net/manual/en/function.date.php

 

Once you know the hour, you can construct a little script to do different things depending on its value:

 

if (date("H")>12) {
    echo "Good afternoon";
} else {
    echo "Good morning";
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.