以下是一个使用PHP编写的判定闰年的实例代码,我们将通过一个简单的函数来判断给定的年份是否为闰年。闰年的判定规则如下:
1. 如果年份能被4整除且不能被100整除,则是闰年。

2. 如果年份能被400整除,则也是闰年。
下面是具体的PHP代码实现:
```php
function isLeapYear($year) {
if (($year % 4 == 0 && $year % 100 != 0) || $year % 400 == 0) {
return true;
} else {
return false;
}
}
// 测试年份
$testYears = [2000, 2001, 2004, 2100, 2200, 2300, 2400];
// 输出结果
foreach ($testYears as $year) {
echo "









