Results 1 to 4 of 4

Thread: Text Changing At Certain Time Of Day

  1. #1
    Join Date
    Feb 2008
    Posts
    90
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Default 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.

  2. #2
    Join Date
    Oct 2008
    Posts
    42
    Thanks
    0
    Thanked 9 Times in 9 Posts

    Default

    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.

  3. #3
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    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.

  4. #4
    Join Date
    Feb 2008
    Posts
    90
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Default

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •