03c03-1.php
来自「介绍PHP5的给类型函数应用」· PHP 代码 · 共 13 行
PHP
13 行
<?php// Let's you know if a certain year is a leap year or not:function is_leap_year($y) { // If the year is divisible by 4 but not by 100 unless by 400 return ((($y % 4) == 0) && ((($y % 100) != 0) || (($y % 400) == 0)));}// Determine for a few years if they are leap years or not:foreach (range(1999, 2009) as $year) { // Output the result: echo "<p>{$year} = ", is_leap_year($year) ? 'Leap Year' : 'not', '</p>';}?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?