Php/docs/function.cal-days-in-month

提供:Dev Guides
< Php
移動先:案内検索

cal_days_in_month

(PHP 4 >= 4.1.0, PHP 5, PHP 7)

cal_days_in_month指定した年とカレンダーについて、月の日数を返す


説明

cal_days_in_month ( int $calendar , int $month , int $year ) : int

この関数は、指定した calendar について yearmonth 月の日数を返します。


パラメータ

calendar
計算に使用するカレンダー。
month
選択したカレンダーにおける月。
year
選択したカレンダーにおける年。


返り値

指定したカレンダーの、その月の日数を返します。


例1 cal_days_in_month() の例

<?php$number = cal_days_in_month(CAL_GREGORIAN, 8, 2003); // 31echo "2003 年 8 月の日数は {$number} 日です";?>