我需要每周从星期一到星期五获取数据,我需要将它分开几周 . 第1周需要是该月的第一周(如果第一周是MON-FRI),但是从第一周开始,到周五结束 . 例如,4月第1周将是周三1日至周五3日一直到第5周是星期一27日到星期四30日(月末)我遇到的问题是如果本月1日它会出现扭曲是在星期六或星期日,而且几周都会被抛弃 .

$week1start = date('m/01/Y',strtotime("this month"));
   $week1end = date('m/d/Y',strtotime("first friday of this month"));
   $week2start = date('m/d/Y',strtotime("first monday of this month"));
   $week2end = date('m/d/Y',strtotime("second friday of this month"));
   $week3start = date('m/d/Y',strtotime(" second monday of this month"));
   $week3end = date('m/d/Y',strtotime("third friday of this month"));
   $week4start = date('m/d/Y',strtotime("third monday of this month"));
   $week4end = date('m/d/Y',strtotime("fourth friday of this month"));
   $week5start = date('m/d/Y',strtotime("fourth monday of this month"));
   $week5end = date('m/30/Y',strtotime("this month"));