我想检查今天是否是本月的最后一天,但我真的不知道怎么做。 我想用php写。
你能帮忙吗?
谢谢, 塞巴斯蒂安
最佳答案
可能有比这更优雅的解决方案,但您可以只使用 php 的日期函数:
$maxDays=date('t');
$currentDayOfMonth=date('j');
if($maxDays == $currentDayOfMonth){
//Last day of month
}else{
//Not last day of the month
}
关于php - 如何获取当月的天数?在 PHP 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3691142/