note 56803 deleted from function.date by tularis
| From: | tularis@php.net | Date: | Thu, 09 Feb 2012 21:07:30 +0000 |
| Subject: | note 56803 deleted from function.date by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-186040@lists.php.net to get a copy of this message | ||
Note Submitter: kbrill at multi dot com
----
I created a routine that fills an array with the dates in the current week. For example
$WeekDays[0] is sunday's date, $WeekDays[1] is monday's date and so on no matter what day
of the week it is today.
<?php
$lowEnd=date("w");
$lowEnd=-$lowEnd;
$highEnd=$lowEnd + 6;
$weekday=0;
for ($i=$lowEnd; $i<=$highEnd; $i++) {
$WeekDate[$weekday]=date("m/d",mktime(0, 0, 0, date("m") ,
date("d")+$i, date("Y")));
$weekday++;
}
?>