note 10483 added to date

From: Date: Sat, 06 Jan 2001 13:59:26 +0000
Subject: note 10483 added to date
Groups: php.notes 
Request: Send a blank email to php-notes+get-9429@lists.php.net to get a copy of this message
These routines will build the perfect array for making calendar. function daysinmonth($month,$year) { $x=1; while(checkdate($month,$x,$year)) { $x++; } return $x-1; } function build_month_array($month, $year) { $current_week = 0; $first_time = 1; for($x=1;$x<=daysinmonth($month,$year);$x++){ $dow = date("w",mktime(0,0,0,$month,$x,$year)); if($dow == 0) { if($first_time == 0) { $current_week++; } } $cal[$current_week][$dow] = $x; $first_time=0; } return $cal; } http://www.php.net/manual/function.date.php

« previous php.notes (#9429) next »