note 95487 deleted from function.date by danbrown

From: Date: Tue, 05 Jan 2010 19:17:14 +0000
Subject: note 95487 deleted from function.date by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-164670@lists.php.net to get a copy of this message
Note Submitter: charline17 gmail.com ---- About the function LastWeek() posted below last week of the year is wrong, I did the following to retrieve the good one : if ($lastweek==0){ $lastday = strtotime("-1 day 01 january".$year); $lastweek = date('W', $lastday); $year--; } in the loop, $week was called instead of lastweek : for ($i=1;$i<=7;$i++){ $arrdays[] = strtotime($year."W".$lastweek.$i); }

« previous php.notes (#164670) next »