Home >Backend Development >PHP Tutorial >PHP method to get the first and last day of a specified month, php last day_PHP tutorial

PHP method to get the first and last day of a specified month, php last day_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:46:201214browse

How to get the first and last day of a specified month in PHP, and the last day in php

The example in this article describes how to get the first and last day of a specified month in PHP. Share it with everyone for your reference. The details are as follows:
Copy code The code is as follows: $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));

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1034537.htmlTechArticleHow to get the first and last day of the specified month in PHP, the last day in php. This article explains how to get the specified month in PHP. First and last day approach. Share it with everyone for your reference. ...
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