最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php生成按指定时间以来的,年、季度、月份的下拉列表
时间:2022-06-24 18:35:54 编辑:袖梨 来源:一聚教程网
代码如下 | 复制代码 |
function countSeason($start,$end){ $temp = date("Y-m",strtotime("$start +3month")); while ($temp $time[] = $temp; $temp = date("Y-m",strtotime("$temp +3month")); } return $time; } $time = countSeason("2008-10",date("Y-m")); ?> |
/*
直接循环
如果是月,则循环变量每次增加1(月)
如果是年,则每次增加12(月),
同时输出date('Y-m')或者 date('Y')
*/
相关文章
- 对决剑之川西河伽罗技能流派有哪些选择 09-18
- 嘟嘟脸恶作剧巴丽叶有什么技能 09-18
- 逆战未来随风之锤性能怎么样 09-18
- 忘川风华录萧绰如何培养 09-18
- 魔兽世界沙塔斯城传送门在哪-沙塔斯城传送门位置分享 09-18
- 为了吾王遗失的补给位置在哪里 09-18