How to get every 15th and last day of the month in PHP

前端 未结 5 1255
执笔经年
执笔经年 2021-01-13 03:21

I am trying to figure out on how to set my dates to every 15th and end of month only...what i\'m getting so far is only +15 days from my current date.. current date = date t

5条回答
  •  执笔经年
    2021-01-13 03:43

    find 15th: strtotime($month_sched." +14 day");

    find last day of month: strtotime($month_sched." next month - 1 hour");

    Please try the following code:

    Tested.

    PHPFiddle

提交回复
热议问题