Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : MCAL Functions : mcal_is_leap_year

mcal_is_leap_year

Returns if the given year is a leap year or not (PHP 4)
bool mcal_is_leap_year ( int year )


Related Examples ( Source code ) » mcal_is_leap_year


Code Examples / Notes » mcal_is_leap_year

wixson

Leap Year Check
// pass a 4digit year
// works for me 1969-2037, will need fix out of that range
// The Gregorian Leap Year Rule
function Gr_IsLeapYr ($yr) {
$isleap=0;
if ($yr % 4 == 0) {
// Years evenly divisible by 4 are leap years.
$isleap=1;
// Exception: Centurial years that are not evenly divisible by 400.
if ( $yr % 100 == 0 && $yr % 400 != 0) {
// not a leap year
$isleap=0;
}
}
return $isleap;
} // end Gr_IsLeapYear


Change Language


Follow Navioo On Twitter
mcal_append_event
mcal_close
mcal_create_calendar
mcal_date_compare
mcal_date_valid
mcal_day_of_week
mcal_day_of_year
mcal_days_in_month
mcal_delete_calendar
mcal_delete_event
mcal_event_add_attribute
mcal_event_init
mcal_event_set_alarm
mcal_event_set_category
mcal_event_set_class
mcal_event_set_description
mcal_event_set_end
mcal_event_set_recur_daily
mcal_event_set_recur_monthly_mday
mcal_event_set_recur_monthly_wday
mcal_event_set_recur_none
mcal_event_set_recur_weekly
mcal_event_set_recur_yearly
mcal_event_set_start
mcal_event_set_title
mcal_expunge
mcal_fetch_current_stream_event
mcal_fetch_event
mcal_is_leap_year
mcal_list_alarms
mcal_list_events
mcal_next_recurrence
mcal_open
mcal_popen
mcal_rename_calendar
mcal_reopen
mcal_snooze
mcal_store_event
mcal_time_valid
mcal_week_of_year
eXTReMe Tracker