HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

cal_days_in_month

Description

The cal_days_in_month of Calendar for PHP return the number of days in a month for a given year and calendar.

Syntax

cal_days_in_month(
    int $calendar,
    int $month,
    int $year
): int

Parameters

calendar

Calendar to use for calculation

ValueConstantDescription
0CAL_GREGORIANGregorian Calendar
1CAL_JULIANJulian Calendar
2CAL_JEWISHJewish Calendar
3CAL_FRENCHFrench Revolutionary Calendar

month

Month in the selected calendar

year

Year in the selected calendar

Return

Returns the length in days of the selected month in the given calendar

Examples

1 · calendar · CAL_GREGORIAN

<?

$calendar = CAL_GREGORIAN;
$month = 1;
$year = 1;

$return = cal_days_in_month($calendar, $month, $year);

echo $return;
31

2 · calendar · CAL_JULIAN

<?

$calendar = CAL_JULIAN;
$month = 1;
$year = 1;

$return = cal_days_in_month($calendar, $month, $year);

echo $return;
31

3 · calendar · CAL_JEWISH

<?

$calendar = CAL_JEWISH;
$month = 1;
$year = 1;

$return = cal_days_in_month($calendar, $month, $year);

echo $return;
30

4 · calendar · CAL_FRENCH

<?

$calendar = CAL_FRENCH;
$month = 1;
$year = 1;

$return = cal_days_in_month($calendar, $month, $year);

echo $return;
30