PHP获得指定日期所在星期的第一天和最后一天

  1. function getdays($day){ 
  2.     $lastday=date('Y-m-d',strtotime("$day Sunday")); 
  3.     $firstday=date('Y-m-d',strtotime("$lastday -6 days")); 
  4.     return array($firstday,$lastday); 
  5. } 
  6. print_r(getdays('2012-06-2')); 
原文地址:https://www.cnblogs.com/love1226/p/7724844.html