- date: documentation ( source)
- strtotime: documentation ( source)
<?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 ;