Home > php教程 > PHP源码 > 使用php获取一个月的第一天和最后一天

使用php获取一个月的第一天和最后一天

PHP中文网
Release: 2016-05-26 08:19:35
Original
1128 people have browsed it

php获取一个月第一天与最后一天直接上代码,其实是个很简单的东东 

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); 
}
Copy after login
Statement of this Website
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
Latest Articles by Author
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template