array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.cal-days-in-month.php', 1 => 'cal_days_in_month', ), 'up' => array ( 0 => 'ref.calendar.php', 1 => 'Calendar 函数', ), 'prev' => array ( 0 => 'ref.calendar.php', 1 => 'Calendar 函数', ), 'next' => array ( 0 => 'function.cal-from-jd.php', 1 => 'cal_from_jd', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/calendar/functions/cal-days-in-month.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.1.0, PHP 5, PHP 7, PHP 8)
cal_days_in_month — 返回指定历法中某年某月的天数
此函数返回指定 calendar
中的某 year
中的某 month
的天数。
calendar
用来计算的历法
month
指定历法中的某月
year
指定历法中的某年
指定历法中所选月份的天数
示例 #1 cal_days_in_month() 示例
<?php
$number = cal_days_in_month(CAL_GREGORIAN, 8, 2003); // 31
echo "There were {$number} days in August 2003";
?>