Home >Backend Development >PHP Problem >How to determine whether the current year is a leap year in php
phpHow to determine whether the current year is a leap year?
Go directly to the code:
<?php $res = date('L')?'是闰年':'不是闰年'; echo $res;
Note: date('L'); can directly determine whether the current year is a leap year. If true, it returns 1, otherwise it returns 0.
Related references:php中文网
The above is the detailed content of How to determine whether the current year is a leap year in php. For more information, please follow other related articles on the PHP Chinese website!