note 25721 rejected from function.mktime by betz
| From: | betz@php.net | Date: | Thu, 03 Oct 2002 09:23:39 +0000 |
| Subject: | note 25721 rejected from function.mktime by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-37614@lists.php.net to get a copy of this message | ||
I would like to retrieve a list of all Saturdays to the end of the year. e.g. If given the next
Saturday after the current day, is there some simple code I could put in a <I>while</I>
loop (while $CURRENT_YEAR= $yearCalc) that would provide this. I have tried:
<?php
echo "Example date entered: 5 October,2002";
$year="2002";
$month="10";
$day="5";
$DATE=$year."-".$month."-".$day;
$TIME=$hour.":".$minute;
$CURYEAR=date("Y");
echo "START<BR>";
while ($year == $CURYEAR)
{
//These two lines present the
//same date calculation in different formats...
$getdate=date("Y-m-d",
mktime(0,0,0,$month,$day+7-date("w",
mktime(0,0,0,$m0nth,$day,$yearr)),$year));
$dateshow=date("l, jS M",
mktime(0,0,0,$month,$day+7-date("w",
mktime(0,0,0,$m0nth,$day,$yearr)),$year));
echo "<BR>Date: ".$dateshow;
$newsplit = explode("-", $getdate);
$year=$newsplit[0];
$month=$newsplit[1];
$day=$newsplit[2];
}
echo "<BR> THE END";
?>
This is kind of URGENT. Thanks in advance to whoever answers this...