$sStr = '2021-12-08';
$sStartDt = date('Y-m-01', strtotime($sStr));
$sLastDt = date('Y-m-d', strtotime($sStr . ' last day of this month'));
php 获取制定月的最后一天与第一天
最新推荐文章于 2023-07-07 11:06:02 发布
这段代码将给定的日期`2021-12-08`转换为当月的第一天`2021-12-01`和最后一天`2021-12-31`,展示了PHP中处理日期的常见操作。

8379

被折叠的 条评论
为什么被折叠?



