php 获取一个月第一天与最后一天的代码
程序员文章站
2023-10-17 17:12:05
复制代码 代码如下:function getthemonth($date) { $firstday = date('y-m-01', strtotime($date));...
复制代码 代码如下:
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);
}