Subversion Repositories php_utils

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 daniel-mar 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
}