note 22028 added to function.date
| From: | sv at secure-servers dot de | Date: | Tue, 04 Jun 2002 10:11:50 +0000 |
| Subject: | note 22028 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31415@lists.php.net to get a copy of this message | ||
If you need the last date of the month you are in you can use this simple script:
#!/usr/bin/php
<?
$today = getdate();
$month = $today['mon'];
$mday = $today['mday'];
$year = $today['year'];
$mday = sprintf ("%02s",$mday);
$month = sprintf ("%02s",$month);
$aktdate = $mday . "." . $month . "." . $year;
# check for last day of month
$lday = 31;
while(!checkdate($month, $lday, $year)) {
$lday--;
}
echo " last date in month is : $lday.$month.$year \n";
?>
--
http://www.php.net/manual/en/function.date.php
http://master.php.net/manage/user-notes.php?action=edit+22028
http://master.php.net/manage/user-notes.php?action=delete+22028
http://master.php.net/manage/user-notes.php?action=reject+22028