mr_badger Posted June 13, 2007 Share Posted June 13, 2007 I have seen on some websites that text and images change depending on the time of day, a bit like a tv schedule where it shows whats on now and then in an hour it changes, does anyone know a script or tutorial that has something like this? Link to comment https://forums.phpfreaks.com/topic/55420-change-text-depending-on-time-of-day/ Share on other sites More sharing options...
AndyB Posted June 13, 2007 Share Posted June 13, 2007 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"; } Link to comment https://forums.phpfreaks.com/topic/55420-change-text-depending-on-time-of-day/#findComment-273887 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.