public function get_weeks($time = '', $format='Y-m-d'){
$time = $time != '' ? $time : time();
//组合数据
$date = [];
$a= 0;
for ($i=1; $i<=7; $i++){
$date[$a] = date($format ,strtotime( '+' . $i-7 .' days', $time));
$a++;
}
return $date;
}
网友评论