function isLeapYear($year) {
return (($year % 4 == 0) && ($year % 100 != 0)) || ($year % 400 == 0);
}
// Example usage:
$year = 2024;
if (isLeapYear($year)) {
echo "$year is a leap year.";
} else {
echo "$year is not a leap year.";
}
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
Subscribe
Login
0 Comments
Oldest