Subversion Repositories php_utils

Rev

Rev 2 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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