Hàm cal_days_in_month () trong PHP
Thí dụ
Nhận số ngày trong tháng cho một năm và lịch cụ thể:
<?php
$d=cal_days_in_month(CAL_GREGORIAN,10,2005);
echo "There was $d days in October 2005";
?>
Định nghĩa và Cách sử dụng
Hàm cal_days_in_month () trả về số ngày trong tháng cho một năm và lịch cụ thể.
Cú pháp
cal_days_in_month(calendar,month,year);
Giá trị tham số
Parameter | Description |
---|---|
calendar | Required. Specifies the calendar to use. Look at the PHP Calendar Constants |
month | Required. Specifies the month in the selected calendar |
year | Required. Specifies the year in the selected calendar |
Chi tiết kỹ thuật
Giá trị trả lại: | Số ngày trong tháng đã chọn, trong năm và lịch nhất định |
---|---|
Phiên bản PHP: | 4.1+ |
❮ Tham khảo lịch PHP