Message: 调用未定义的函数 cal_days_in_month()

huangapple go评论55阅读模式
英文:

Message: Call to undefined function cal_days_in_month()

问题

需要帮助解决PHP中的以下错误:
>消息:调用未定义的函数cal_days_in_month()

$currentdate = date('2023-07');
$convertmoon = date('Y-m', strtotime($currentdate));
$convertdate = strtotime($currentdate);

// 当前年份,月份,日期
$get_yy_thismonth = date('Y', strtotime($currentdate));
$get_mf_thismonth = date('F', strtotime($currentdate));
$get_mm_thismonth = date('m', strtotime($currentdate));
$get_mn_thismonth = date('n', strtotime($currentdate));
$get_dt_thismonth = date('d', strtotime($currentdate));
$get_dy_thismonth = date('D', strtotime($currentdate));
$get_dz_thismonth = date('t', strtotime($currentdate));

$get_nn_thismonth = date('Y-m', strtotime($currentdate));
$totaldays_of_thismonth = cal_days_in_month(CAL_GREGORIAN, $get_mm_thismonth, $get_yy_thismonth);

英文:

Need help to solve the following error in PHP
>Message: Call to undefined function cal_days_in_month()

$currentdate = date('2023-07');
$convertmoon = date('Y-m', strtotime($currentdate));
$convertdate = strtotime($currentdate);

// Current Year, Month, Date
$get_yy_thismonth = date('Y', strtotime($currentdate));
$get_mf_thismonth = date('F', strtotime($currentdate));
$get_mm_thismonth = date('m', strtotime($currentdate));
$get_mn_thismonth = date('n', strtotime($currentdate));
$get_dt_thismonth = date('d', strtotime($currentdate));
$get_dy_thismonth = date('D', strtotime($currentdate));
$get_dz_thismonth = date('t', strtotime($currentdate));

$get_nn_thismonth = date('Y-m', strtotime($currentdate));
$totaldays_of_thismonth = cal_days_in_month(CAL_GREGORIAN, $get_mm_thismonth, $get_yy_thismonth);

答案1

得分: 1

根据我的了解,它已安装但未启用。找到您的php.ini文件,并通过删除开头的分号取消注释该行;extension=calendar

英文:

To my knowledge it is installed but not enabled. Locate your php.ini fie and un-comment the line ;extension=calendar by removing the semi-colon at the beginning

huangapple
  • 本文由 发表于 2023年7月14日 00:37:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/76681603.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定