/** * 获取起止日期之间所有日期 * @param $sdate * @param $edate * @return array */ function get_dates($sdate, $edate) { $_arr_date = array(); $time_start = strtotime($sdate); $time_end = strtotime($edate); while ($time_start <= $time_end) { $_arr_date[] = date('Y-m-d', $time_start); $time_start = strtotime('+1 day', $time_start); } return $_arr_date; } echo '<br>', date("l", strtotime('2019-02-21')); //英文星期 Thursday echo '<br>', date("w", strtotime('2019-02-21')); //数字星期 0123456,其中0为星期日