3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = date("Y-m-d"); $firstday = date("Y-m-01",strtotime($date)); //取得指定时间所属月的最后一天 $lastday = date("Y-m-d",strtotime("$firstday +1 month -1 day")); echo $lastday ;

preferences:
30.16 ms | 402 KiB | 5 Q