Posted By

takel on 03/04/11


Tagged

week range


Versions (?)

week range - get the start and end date of the week


 / Published in: PHP
 

  1. function week_range($date) {
  2. $ts = strtotime($date);
  3. $start = (date('w', $ts) == 0) ? $ts : strtotime('last monday', $ts);
  4. return array(date('d.m.Y', $start), date('d.m.Y', strtotime('next sunday', $start)));
  5. }

Report this snippet  

You need to login to post a comment.