[Php 4> = 4.1.0, Php 5, Php 7, Php 8]
Cal_days_in_month - Trả lại số ngày trong một tháng cho một năm và lịch nhất định — Return the number of days in a month for a given year and calendar
Sự mô tả
cal_days_in_month [int $calendar
, int $month
, int $year
]: int[int $calendar
, int $month
, int $year
]:
int
Thông số
calendar
Lịch sử dụng để tính toán
month
Tháng trong lịch đã chọn
year
Năm trong lịch được chọn
Trả về giá trị
Độ dài trong các ngày của tháng được chọn trong lịch đã cho
Ví dụ
Ví dụ #1 cal_days_in_month [] Ví dụcal_days_in_month[] example
Brian tại B5Media Dot Com ¶ ¶
14 năm trước
Remember if you just want the days in the current month, use the date function:
$days = date["t"];
dbindel tại Austin dot rr dot com ¶ ¶
18 năm trước
Here's a one-line function I just wrote to find the numbers of days in a month that doesn't depend on any other functions.
The reason I made this is because I just found out I forgot to compile PHP with support for calendars, and a class I'm writing for my website's open source section was broken. So rather than recompiling PHP [which I will get around to tomorrow I guess], I just wrote this function which should work just as well, and will always work without the requirement of PHP's calendar extension or any other PHP functions for that matter.
$month
0
$month
1
$month
2datlx tại yahoo dot com ¶ ¶
1 tháng trước
$month
3
$month
4
$month
5
$month
6
$month
2Jeffbeall tại Comcast Dot Net ¶
18 năm trước
$month
8
datlx tại yahoo dot com ¶ ¶
1 tháng trước
$month
9
$year
0
$year
1