Check if Given Year is Leap Year using PHP

date function

<?php

$year = 2024;
$isLeapYear = (bool) date('L', mktime(0, 0, 0, 1, 1, $year));

var_dump($isLeapYear);

Leave a Comment

Cancel reply

Your email address will not be published.