技术社区 / 交流共享 / PHP获取当月、下月、上月的天数

PHP获取当月、下月、上月的天数

PHP 置顶
--
2024-04-08 13:40:36 阅读 4342 评论 0

 当前月有多少天

$thisMonthDays = date('t');
echo '本月'.$thisMonthDays .'天';

上月有多少天

$lastMonthDays = date('t', strtotime('+1 month'));
echo '上月'.$lastMonthDays .'天';

下月有多少天

$nextMonthDays = date('t', strtotime('-1 month'));
echo '下月'.$nextMonthDays .'天';

评论(0)

消灭零回复,来发表第一条评论吧
咨询热线
15899929162 0769-82882996 400-6116-696
微信扫码咨询
返回顶部