TT calendar library returnmontharray
returnmontharray -- Returns a month array for a given month

Description

array returnmontharray(int month,int year[,array daynames])

Returns an array representing the display format of a given month. For details of the array format see the about the month arrays used by this library page.

month is an integer between 1 and 12, where 1 represents January and 12 represents December.

year is a 4 figure integer representation of the year, e.g. 2004

daynames is an optional parameter representing the names of the dates appearing at the tops of the columns in the calendar. This is a simple list of strings representing the day names from Sunday to Saturday inclusive.
If daynames is not set, it defaults to array("S","M","T","W","T","F","S").

Examples

The code below returns a month array for march 2004 and displays it.
include("ttcalendar.php");

$our_month = 3; #march
$our_year = 2004;
$month_array = returnmontharray($our_month,$our_year);

echo returnmonthhtml($month_array,"#ffffff");

Here is the HTML returned:
SMTWTFS
123456
78910111213
14151617181920
21222324252627
28293031

And here's the same example, this time with some different day names.
include("ttcalendar.php");

$our_month = 3; #march
$our_year = 2004;
$daynames = array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
$month_array = returnmontharray($our_month,$our_year,$daynames);

echo returnmonthhtml($month_array,"#ffffff");

Here is the HTML returned:
SunMonTueWedThuFriSat
123456
78910111213
14151617181920
21222324252627
28293031

returnmonthlength Contents dayrangecolour