3v4l.org

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

preferences:
37.07 ms | 402 KiB | 5 Q