是否可以使用以下方法计算当月的第3天:
echo gmdate('Y-m-d H:i:s' , mktime({what goes here}));
我想要的结果的一些例子:
答案 0 :(得分:1)
$year = 2014;
foreach(range(1,12) as $month) {
$time = gmdate("F jS",strtotime('-3 days',strtotime(date("Y-$month-t",strtotime("$year-$month-01")))));
print $time . "\n";
}
<强>输出强>
January 28th
February 25th
March 28th
April 27th
May 28th
June 27th
July 28th
August 28th
September 27th
October 28th
November 27th
December 28th