php 获取一个月第一天与最后一天的代码
(编辑:jimmy 日期: 2024/11/30 浏览:3 次 )
复制代码 代码如下:
function getthemonth($date)
{
$firstday = date('Y-m-01', strtotime($date));
$lastday = date('Y-m-d', strtotime("$firstday +1 month -1 day"));
return array($firstday, $lastday);
}
function getthemonth($date)
{
$firstday = date('Y-m-01', strtotime($date));
$lastday = date('Y-m-d', strtotime("$firstday +1 month -1 day"));
return array($firstday, $lastday);
}
下一篇:PHP 缓存实现代码及详细注释