title: PHP "unexpected $end"
body: <p>i actually checked my code like a hundred times, but i cant find the error:</p>
  
  <p>The error i get:
  Parse error: syntax error, unexpected $end in /home/tennox/public_html/php/kalender.php on line 46 </p>
  
  <p>I tried to do a function that calculates the easter sunday, in another script without all the other it just works, but in this one not. The other way round the same thing!</p>
  
  <pre><code>&lt;?php
  $year = isset($_POST['year']) ? intval($_POST['year']) : date('Y');
  $months = array("", "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember");
  $days = array('So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa');
  $ostern = getOsterSonntag($year);
  ?&gt;
  &lt;form action="kalender.php" method="POST" target="_self"&gt;
  &lt;input type="text" name="year" value="&lt;?php echo $year; ?&gt;"&gt;
  &lt;/form&gt;
  &lt;table border="1" cellspacing="0"&gt;
  &lt;?php
  for($y=0; $y&lt;32; $y++) {
     echo "&lt;tr height=\"20\"&gt;";
     for($x=1; $x&lt;=12; $x++) {
        echo "&lt;td width=\"5%\"&gt;";
        $date = strtotime("$y.$x.$year");
        $day = date("d", $date);
        $dayname = $days[date("w", $date)];
  
        if ($y == 0) {
           echo "&lt;div align=\"center\"&gt;&lt;b&gt;$months[$x]&lt;/b&gt;&lt;/div&gt;";
        } elseif ($y &lt; date("t",$date) &amp;&amp; !($y == 30 &amp;&amp; $x == 2)) {
           if (date("w", $date) == 6 || date("w", $date) == 0)
              echo "&lt;b&gt;";
           echo "$day $dayname";
           if ($date == $ostern)
              echo "(Ostersonntag)";
           if (date("w", $date) == 6 || date("w", $date) == 0)
              echo "&lt;/b&gt;";
        } else {
           echo "   -   ";
        }
        echo "&lt;/td&gt;";
     }
     echo "&lt;/tr&gt;";
  }
  ?&gt;
  &lt;/table&gt;
  
  &lt;?php
  function getOsterSonntag($year) {
     $a = $year % 19;
     $b = $year % 4;
     $c = $year % 7;
     $k = floor($year / 100);
     $p = floor((8*$k + 13) / 25);
     $q = ($k / 4);
     $d = (19*$a + ((15 + $k - $p - $q) % 30)) % 30;
     $e = (2*$b + 4*$c + 6*$d + ((4 + $k - $q) % 7)) % 7;
  
     $ostern = 22 + $d + $e;
     if ($ostern &gt; 31){
        $ostern -= 31;
        return strtotime("$ostern.4.$year");
     } else
        return strtotime("$ostern.3.$year");
  }
  ?&gt;
  </code></pre>