title: Creation of weekly calender in php
body: <p>I have created a php calender which will show one week at a time.Here is the code i have created</p>
  
  <pre><code> &lt;?php
     $week = date("W");
     $year = (isset($_GET['year']))?$_GET['year']:date("Y");
     $week = (isset($_GET['week']))?$_GET['week']:Date('W');
     if($week&gt;53){
       $year+= 1;
       $week=1;
     }
   ?&gt;
  
   &lt;a href="&lt;?php echo $_SERVER['PHP_SELF'].'?week='.($week+1).'&amp;year='.$year; ?&gt;"&gt;Next  Week&lt;/a&gt; &lt;!--Next week--&gt;
  
   &lt;a href="&lt;?php echo $_SERVER['PHP_SELF'].'?week='.($week-1).'&amp;year='.$year; ?&gt;"&gt;Pre Week&lt;/a&gt; &lt;!--Previous week--&gt;
  
   &lt;table border="1px"&gt;
   &lt;tr&gt;
   &lt;td&gt;Employee&lt;/td&gt;
   &lt;?php
   for($day=1; $day&lt;=7; $day++)
   {
      $d = strtotime($year."W".$week.$day);                           
      echo "&lt;td&gt;".date('l',$d )."&lt;br&gt;";
      echo date('d M',$d)."&lt;/td&gt;";
   }
   ?&gt;
   &lt;/tr&gt;
  </code></pre>
  
  <p>when i am trying to go to the next week it is working correctly. But when the year is changing it is not working for the next year.</p>