note 25721 added to function.mktime

From: Date: Thu, 03 Oct 2002 06:16:42 +0000
Subject: note 25721 added to function.mktime
Groups: php.notes 
Request: Send a blank email to php-notes+get-37595@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... -- http://www.php.net/manual/en/function.mktime.php http://master.php.net/manage/user-notes.php?action=edit+25721 http://master.php.net/manage/user-notes.php?action=delete+25721 http://master.php.net/manage/user-notes.php?action=reject+25721

« previous php.notes (#37595) next »