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
Value | Constant | Description |
---|---|---|
0 | CAL_GREGORIAN | Gregorian Calendar |
1 | CAL_JULIAN | Julian Calendar |
2 | CAL_JEWISH | Jewish Calendar |
3 | CAL_FRENCH | French 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