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

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

PHP中文网
PHP中文网Original
2016-05-26 08:19:35986browse

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); 
}
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
Previous article:GET和POST的真正区别Next article:十进制数的次方