note 75048 added to function.date

From: Date: Thu, 10 May 2007 03:32:07 +0000
Subject: note 75048 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-126374@lists.php.net to get a copy of this message
... class CalendarFunction { function holidays($year) { $return = array(); $return[ 1] = array(1); $return[12] = array(25); // feriados moveis return $return; } function qtDaysPerMonth($year, $month) { return intval(date('t', mktime(0, 0, 0, intval($month), 1, intval($year)))); } function daysPerMonth($year) { $return = array(); $weekday = date('w', mktime(0, 0, 0, 1, 1, intval($year))); $holidays = CalendarFunction::holidays($year); for ($month = 0; $month < 12; $month++) { $qt = CalendarFunction::qtDaysPerMonth($year, $month+1); $holidays_month = (isset($holidays[$month+1]) ? $holidays[$month+1] : array()); for($day = 1; $day <= $qt; $day++) { if (($weekday > 0 and $weekday < 6) and !in_array($day, $holidays_month)) { $return[$month+1][] = $day; } $weekday = ($weekday == 6 ? 0 : $weekday + 1); } } return $return; } } ... ---- Server IP: 69.147.83.197 Probable Submitter: 189.0.196.18 ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- https://master.php.net/note/edit/75048 Del: integrated -- https://master.php.net/note/delete/75048/integrated Del: useless -- https://master.php.net/note/delete/75048/useless Del: bad code -- https://master.php.net/note/delete/75048/bad+code Del: spam -- https://master.php.net/note/delete/75048/spam Del: non-english -- https://master.php.net/note/delete/75048/non-english Del: in docs -- https://master.php.net/note/delete/75048/in+docs Del: other reasons-- https://master.php.net/note/delete/75048 Reject -- https://master.php.net/note/reject/75048 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#126374) next »