谁能告诉我为什么当日期 >= 2013-01-06 时以下失败
太奇怪了,当日期在这个日期之后时,脚本可以完美运行,但之前的任何东西都可以,我得到了白屏死机!
<?php
use Carbon\Carbon;
$startDate = Carbon::createFromFormat('Y-m-d', '2013-01-06');
$current_week = Carbon::now()->timestamp;
/*
$startDate = strtotime('2013-01-06');
$current_week = strtotime(date('Y-m-d'));
*/
$weeks = array();
$w = 0;
while($startDate < $current_week){
$weeks[$w] = array(
'monday' => $startDate->startofWeek()->format('d/m/Y'),
'sunday' => $startDate->endofWeek()->format('d/m/Y')
);
$w++;
$startDate = $startDate->addDays(1); // Move it on to the following week
}
var_dump($weeks);
?>
请问有人可以帮我吗?!