Skip to content

Instantly share code, notes, and snippets.

@jehoshua02
Created February 29, 2012 23:29
Show Gist options
  • Select an option

  • Save jehoshua02/1945427 to your computer and use it in GitHub Desktop.

Select an option

Save jehoshua02/1945427 to your computer and use it in GitHub Desktop.
function to determine if year is a leap year
<?php
function is_leap_year($year = NULL)
{
if (empty($year)) $year = date('Y');
return ($year % 4 == 0 && ($year % 100 != 0 || $year % 400 == 0));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment