21,886
社区成员
发帖
与我相关
我的任务
分享
$tmp = $d1 = strtotime('2011-01-01');
$d2 = strtotime('2011-04-24');
$counter = 0;
while($tmp <= $d2) {
if (date('w',$tmp) == 1) $counter ++;
$tmp += 24 * 60 * 60;
}
echo date('Y-m-d',$d1).'-'.date('Y-m-d',$d2)."期间共有{$counter}个星期一\n";