Subversion Repositories php_utils

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. function get_last_weekday_date($dow) {
  4.         for ($i=0; $i<=6; $i++) {
  5.                 $d = ftime()-$i*86400;
  6.                 $e = date('N', $d);
  7.                 if ($e == $dow) {
  8.                         return date('d.m.Y', $d);
  9.                 }
  10.         }
  11. }
  12.