note 22028 deleted from function.date by sniper
| From: | sniper@php.net | Date: | Sat, 11 Oct 2003 16:49:35 +0000 |
| Subject: | note 22028 deleted from function.date by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58254@lists.php.net to get a copy of this message | ||
Note Submitter: sv@secure-servers.de
----
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";
?>