note 55906 added to function.date
| From: | serban dot nistor at gmail dot com | Date: | Wed, 17 Aug 2005 09:49:29 +0000 |
| Subject: | note 55906 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-93783@lists.php.net to get a copy of this message | ||
A simple function similar to the "cal -j" UNIX command:
<?php
function getDays() {
$months=Array(31,28,31,30,31,30,31,31,30,31,30,31);
$days=0;
for($i=0;$i<date("n")-1;$i++) $days+=$months[$i];
$days+=date("j");
if(date("L")&&date("n")>=2) $days+=1;
return $days;
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55906
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55906&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55906&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55906&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55906&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55906&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55906&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55906&report=yes
Search -- http://master.php.net/manage/user-notes.php