date()函数获取每个月时间

date('Y-m-d',strtotime('2021-01-01'));

date('Y-m-t',strtotime('2021-01'));

//t,表示每个月的最后一天

踩过这个坑,还有下一个坑等着你,这一路就是给自己填坑,坑填多了,也就习惯了,直到这一路平坦了,也就无怨无悔了。
原文地址:https://www.cnblogs.com/xiaofeilin/p/14357577.html