Re: day in week

From: Date: Thu, 26 Jul 2007 09:45:52 +0000
Subject: Re: day in week
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-259549@lists.php.net to get a copy of this message
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

« previous php.general (#259549) next »