站长资源网络编程

php 获取一个月第一天与最后一天的代码

整理:jimmy2024/10/31浏览2
简介复制代码 代码如下:function getthemonth($date) { $firstday = date('Y-m-01', strtotime($date)); $lastday = date('Y-m-d', strtotime("$firstday +1 month -1 day"))
复制代码 代码如下:
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);
}