3v4l.org

run code in 300+ PHP versions simultaneously
<?php $currentDate = date('Y-m-d'); // 使用strtotime计算下个月一号 $nextMonthFirstDay = date('Y-m-d', strtotime('first day of next month', strtotime($currentDate))); echo $nextMonthFirstDay; // 输出格式为 YYYY-MM-DD

preferences:
25.59 ms | 405 KiB | 5 Q