Web resources
>
Calendar >
Is a leap year?
Leap year
2024
is a leap year
Those that are multiples of 4 are leap year.
Except for secular years (multiples of 100) that are not multiples of 400.
Wikipedia: Leap year / Gregorian calendar
Wikipedia: Leap year / Gregorian calendar
// PHP function to know if it is a leap year
// Return Boolean: true / falsefunction AnyDeTraspas($any){
/* Author: arnAu bellavista
www.BinariEM.com
Gener 2021 */
if($any % 4 == 0){
$secular = substr($any, -2);
if($secular == '00' and $any % 400 != 0){
return false;
}else{
return true;
}
}else{
return false;
}
}
// Cridem la funció i la guardem una variable boleana
$any_de_traspas = AnyDeTraspas('2021');
// Return Boolean: true / false