note 56803 added to function.date
| From: | kbrill at multi dot com | Date: | Thu, 15 Sep 2005 15:27:35 +0000 |
| Subject: | note 56803 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-95230@lists.php.net to get a copy of this message | ||
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++;
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56803
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56803&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56803&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56803&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56803&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56803&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+56803&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56803&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56803&report=yes
Search -- http://master.php.net/manage/user-notes.php