英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论