Get all days and date for a given month

后端 未结 9 1525
天涯浪人
天涯浪人 2021-02-10 08:17

Would like to retrieve all days and date for a given month. Have this currently which shows all the days for the current month, but how do I parse in a specified month instead?<

9条回答
  •  花落未央
    2021-02-10 08:53

    $days = cal_days_in_month( 0, $month, $year);
    

    cal_days_in_month: Return the number of days in a month for a given year and calendar.
    First parameter is "calendar":

    0 or CAL_GREGORIAN - Gregorian Calendar
    1 or CAL_JULIAN - Julian Calendar
    2 or CAL_JEWISH - Jewish Calendar
    3 or CAL_FRENCH - French Revolutionary Calendar

    http://php.net/manual/en/function.cal-days-in-month.php

    http://php.net/manual/en/function.cal-info.php

提交回复
热议问题