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? Quote 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"; } Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.