php 获取本周一 时间

来源:互联网 发布:天刀神威捏脸数据 编辑:程序博客网 时间:2024/05/17 02:56

function this_monday($timestamp=0,$is_return_timestamp=true){      static $cache ;      $id = $timestamp.$is_return_timestamp;      if(!isset($cache[$id])){          if(!$timestamp) $timestamp = time();          $monday_date = date('Y-m-d', $timestamp-86400*date('w',$timestamp)+(date('w',$timestamp)>0?86400:-/*6*86400*/518400));          if($is_return_timestamp){              $cache[$id] = strtotime($monday_date);          }else{              $cache[$id] = $monday_date;          }      }      return $cache[$id];      }



PHP 获取本周一时间



阅读全文
0 0
原创粉丝点击