获取所在月第一天和最后一天

$BeginDate = date('Y-m-01', strtotime(date("Y-m-d")));
echo $BeginDate;
echo "<br/>";
echo date('Y-m-d', strtotime("$BeginDate +1 month -1 day"));
echo "<br/>";
exit;
原文地址:https://www.cnblogs.com/pansidong/p/8665617.html