-
Text Changing At Certain Time Of Day
Is it possible to make text say, "Good Morning!" between 6:00AM and 11:59AM. Then change to "Good Afternoon!" between 12:00 and 5. and "Good Evening" between 5:01 and 9. and "Goodnight" between 9:01 and 5:59?
And maybe even display different things between a Monday morning at 9 am, and a Tuesday morning at 9 am?
Is this possible using php?
Thanks.
-
-
Based on server time, yes it is possible.
Look into the date() and time() functions. From there a simple conditional can determine which phrase to echo.
-
-
This sounds a lot like a homework problem that you must complete for a class.
My suggestion would be to do some research into the two functions that John pointed out in the above post, but for future reference, this isn't a place to ask for others to complete your homework. If you have questions about a concept then yes we can help you, but if you do not do the work yourself you aren't going to learn the language, and thus it's pointless to be taking the class.
-
Thanks for your response but you can please leave your assumptions out of your posts. Notice, i did not ask anyone to do any work for me, i simply asked if something like that would work, a concept. "Forums are online user groups that give users a chance to research questions or ask their own."
Forgive me for asking a question and inconveniencing you in anyway.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks