您当前的位置: 首页 > 学无止境 > 心得笔记 网站首页心得笔记
php获取上个月信息
发布时间:2018-01-08 13:45:34编辑:雪饮阅读()
function getlastMonthDays($date){
$timestamp=strtotime($date);
$firstday=date('Y-m-01',strtotime(date('Y',$timestamp).'-'.(date('m',$timestamp)-1).'-01'));
$lastday=date('Y-m-d',strtotime("$firstday +1 month -1 day"));
return array($firstday,$lastday);
}
$arr=getlastMonthDays(date("Y-m-d",time()));
echo "<pre>";
print_r($arr);
echo "</pre>";
关键字词:php,上月,获取
上一篇:支付接口异步通知设计