note 34232 added to function.cal-days-in-month
| From: | fie at myrealbox dot com | Date: | Sat, 19 Jul 2003 00:07:06 +0000 |
| Subject: | note 34232 added to function.cal-days-in-month | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-52369@lists.php.net to get a copy of this message | ||
// FORMER
$dim = date("t", mktime(0, 0, 0, date("m"), 1, date("Y")));
//LATTER
$dim = array(31,28,31,30,31,30,31,31,30,31,30,31);
if($date[year] % 4 == 0)$daysinmonth[1] = 29;
$daysinmonth = $dim[$date[mon]-1];
in my tests the latter succeeded the former.. DONT BE FOOLED JUST BECAUSE THEY ARE PREINSTALLED
DOSNT MEAN THAT THEY WILL WORK FASTER!
also supposedly the time in php will fail to work in 2037, which i hope they fix in php5 but
i'm just making a point. Mine is like cross-language and slightly faster or whatever yea ok.
----
Manual Page -- http://www.php.net/manual/en/function.cal-days-in-month.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34232
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34232&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34232&report=yes