RE: [PHP] finding Friday's date
| From: | Adam Plocher | Date: | Tue, 27 Feb 2001 21:51:18 +0000 |
| Subject: | RE: [PHP] finding Friday's date | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-41879@lists.php.net to get a copy of this message | ||
Yeah I think that would work, but (as an example..) if the upcoming Friday
was on the 1st of next month, and today was Wednesday the 30th, would it
think that Friday was on the 32nd?
-----Original Message-----
From: Andrew Rush [mailto:andy@mainetoday.com]
Sent: Tuesday, February 27, 2001 12:59 PM
To: Adam Plocher
Subject: Re: [PHP] finding Friday's date
on 2/27/01 03:39 PM, Adam Plocher at aplocher@erepublic.com wrote:
> Could somebody show me an example of a script that will find out the date
of
> each upcoming Friday, thanks.
something like:
$days=array("Saturday", "Sunday", "Monday", "Tuesday",
"Wednesday",
"Thursday", "Friday");
$today=date(l);
$todayNum=date(j);
if($today == "Friday") {
fDate=date("m-d-Y");
} else {
$todayKey=array_keys($days, $today);
for($i=$todayKey; $i < count($days); $i++)) {
$daysTilFri=$i;
}
$friday=$todayNum+$daysTilFri;
$friday=date("m-$friday-Y");
}
maybe? untested.