Skip to content

Instantly share code, notes, and snippets.

@manticorp
Created March 12, 2013 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manticorp/5142986 to your computer and use it in GitHub Desktop.
Save manticorp/5142986 to your computer and use it in GitHub Desktop.
Function to determing if the year given is a leap year. Defaults to the current year.
function is_leap($year = NULL) {
return checkdate(2, 29, ($year == NULL)? date('Y'):$year); // true if is a leap year
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment