Re: day in week

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christian Hänsel wrote:
Good morning fellas,

I was wondering if there was a function like "is_this_week()"...

What I have is a statistics table for the last week, from strtotime("Last Monday") to strtotime("Last Sunday")... now I wanna put a different background colour on the rows where the shown weekday is in the current week... I hope you guess what I'm shooting at :o) So if today is Thursday, everything from "last monday" to "last thursday" should be shown in a different colour.

Does anybody have an idea? I was thinking of doing it with time() and maths.... but I was hoping there was a simpler approach.

All the best, the weekend is near!

Chris


for each of your days run a date('W', $thatDate) and compare it to a date('W', time()). the W modifier returns a weeknumber, if they match, it's this week, otherwise it's not.

- tul

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux