Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?PHP
  2.     $montag = montag("20.01.2038");
  3.  
  4.     for($i=0;$i<=6;$i++)
  5.         {
  6.             $datum = date("d.m.Y",strtotime("+$i day", strtotime("$montag")));
  7.             echo $datum."<br>";
  8.         }
  9.  
  10.     function montag($datum)
  11.         {
  12.             $dt = explode(".", $datum);
  13.             $wochentag = strftime("%w",mktime(0,0,0,$dt[1],$dt[0],$dt[2]))-1;
  14.             if($wochentag == -1)
  15.                 {
  16.                     $wochentag = 6;
  17.                 }
  18.             return date("d.m.Y",mktime(0,0,0,$dt[1],$dt[0]-$wochentag,$dt[2]));
  19.         }
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement