php 得到上周,本周,上月,本月,本季度,上季度
出处:http://hudeyong926.iteye.com/blog/729193
php两个日期相减得天数 <?php function count_days($a,$b){ $a_dt=getdate($a); $b_dt=getdate($b); $a_new=mktime(12,0,0,$a_dt['mon'],$a_dt['mday'],$a_dt['year']); $b_new=mktime(12,0,0,$b_dt['mon'],$b_dt['mday'],$b_dt['year']); return round(abs($a_new-$b_new)/3600/24); } function count_days($formdate,$todate){ return round(abs(strtotime($formdate)-strtotime($todate))/3600/24); }
?