Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- $montag = montag("20.01.2038");
- for($i=0;$i<=6;$i++)
- {
- $datum = date("d.m.Y",strtotime("+$i day", strtotime("$montag")));
- echo $datum."<br>";
- }
- function montag($datum)
- {
- $dt = explode(".", $datum);
- $wochentag = strftime("%w",mktime(0,0,0,$dt[1],$dt[0],$dt[2]))-1;
- if($wochentag == -1)
- {
- $wochentag = 6;
- }
- return date("d.m.Y",mktime(0,0,0,$dt[1],$dt[0]-$wochentag,$dt[2]));
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement