|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 | |
|
Member (7 bit)
|
Need some help with a piece of PHP code
Ok, I have have a simple PHP code that displays the current time depending on the time offset that I set it. Due to the fact that I'm pretty new at PHP, I have no clue how to do this, but have a general idea, so I wonder if you guys might be able to help me. What I want the code to do, is whenever the time is between 9:00 and 21:30 is prints the text out green, and when the time is not between those two times it prints out red. Not entirely sure how I would go about doing this. TIA.
Justin Here is the code: Quote:
|
|
|
|
|
|
|
#2 | |
|
Member (7 bit)
|
Well, after looking at the code, and checking on some things, I realized that I could use if statements. I love IF statements
. Here is my finished working PHP code .Quote:
|
|
|
|
|
|
|
#3 |
|
Member (9 bit)
|
Looks good--you did forget the l in the second $melbdate in the IF statement though.
|
|
|
|
|
|
#4 |
|
Member (7 bit)
|
Yeah, I didn't realize that until 9:30 tonight when it didn't change to red, so I went back and realized that it was missing. Spelling mistakes rule.
|
|
|
|
|
|
#5 |
|
Member (9 bit)
|
They're the worst, especially if you don't notice it right away. I've yelled at my computer for hours before realizing I spelled the variable wrong.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|