note 94150 added to function.date
| From: | Anonymous at osu1 dot php dot net | Date: | Mon, 19 Oct 2009 19:16:16 +0000 |
| Subject: | note 94150 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-161880@lists.php.net to get a copy of this message | ||
re: dev at omikrosys dot com
<?php
function leapYear($year) {
return (date('L', mktime(0, 0, 0, 1, 1, $year)) == 1);
}
function daysInMonth($month = 0, $year = '') {
$months = array("Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug", "Sept",
"Oct", "Nov", "Dec");
if (!is_numeric($year) || strlen($year) != 4) {
$year = date('Y');
}
if (!is_numeric($month)) {
$month = in_array($month, $months) ? (array_search($month, $months) + 1) : false;
}
return $month ? date('t', mktime(0, 0, 0, $month, 1, $year)) : 0;
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 64.55.81.130
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- https://master.php.net/note/edit/94150
Del: integrated -- https://master.php.net/note/delete/94150/integrated
Del: useless -- https://master.php.net/note/delete/94150/useless
Del: bad code -- https://master.php.net/note/delete/94150/bad+code
Del: spam -- https://master.php.net/note/delete/94150/spam
Del: non-english -- https://master.php.net/note/delete/94150/non-english
Del: in docs -- https://master.php.net/note/delete/94150/in+docs
Del: other reasons-- https://master.php.net/note/delete/94150
Reject -- https://master.php.net/note/reject/94150
Search -- https://master.php.net/manage/user-notes.php