Home >php教程 >php手册 >PHP获取指定月份第一天和最后一天的方法

PHP获取指定月份第一天和最后一天的方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 19:51:311557browse

这篇文章主要介绍了PHP获取指定月份第一天和最后一天的方法,涉及php针对日期操作的相关技巧,具有一定参考借鉴价值,需要的朋友可以参考下

本文实例讲述了PHP获取指定月份第一天和最后一天的方法。分享给大家供大家参考。具体如下:

复制代码 代码如下:

$date = date(time());
$start_date = date('Y-m-d', mktime(00, 00, 00, date('m', strtotime($date))+1, 01));
$end_date = date('Y-m-d', mktime(23, 59, 59, date('m', strtotime($date))+2, 00));

希望本文所述对大家的php程序设计有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn