实现从指定时间向下推n个月的函数_PHP

WBOY
Release: 2016-06-01 12:40:49
Original
1258 people have browsed it

作者: bjbs_270
前一段时间做了一个月报表统计用下了如题的功能,结合别人用mktime()函数我写了一个可是后来老是出错,郁闷极。周末抽出一点时间写一个来用,但愿能对部分村民有用。

PHP代码:--------------------------------------------------------------------------------


/*
* 作者:心灯
* 功能:实现从指定时间向下推N个月的函数
* month($ymd,$len) $ymd时间,$len推出几个月
* $ymd='2005-01-01';
*/
function month($ymd=',$len='12'){
$month = array();
$lang = $lang."";
if($ymd){//

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template