php获取最近7天的日期
function getDateSeven($time = '', $format = 'Y-m-d') { $time = $time != '' ? $time : time(); //获取当前周几 // $week = date('w', $time); $date = []; for ($i = 0; $i <= 6; $i++) { $date[$i] = date($format, strtotime('-' . $i . ' days', $time)); } return $date; }
╰︶﹉⋛⋋⊱⋋๑๑⋌⊰⋌⋚﹉︶╯