note 15438 deleted from function.time by jimw

From: Date: Sat, 08 Dec 2001 23:53:56 +0000
Subject: note 15438 deleted from function.time by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-22387@lists.php.net to get a copy of this message
To Caspar (re: find Mondays in a time period): Use mktime() to set your start and stop dates for your scanning loop (have the stop date be one day after your actual desired stop date). Then use date() to match the day of the week with the timestamp loop. Example: for ($i=mktime(0,0,0,9,6,2001); $i<mktime(0,0,0,9,27,2001);) { if (date("w",$i) == 1) { echo date("mdy",$i)." is a Monday";} $i = $i + 86400; // jump ahead to the next day }

« previous php.notes (#22387) next »