title: Parse error: syntax error, unexpected '$ts' (T_VARIABLE), expecting ',' or ')' in C:\xampp\htdocs\www\cal.php on line 261
body: <p>I am having problem debugging my code. I am following a tutorial to build a calendar app. But the above error is being displayed each time I attempt to run it. Therefore I need help to spot out the error.</p>
  
  <p>The following are the lines of the code:</p>
  
  <pre><code>public function displayEvent($id)
  {
      /*
      *Make sure an ID was passed
      */
      if ( empty($id) ) { return NULL; }
  
      /*
      *Make sure an ID is an integer
      */
      $id = preg_replace('/[^0-9]/', '', $id);
  
      /*
      *Load the event data from the DB
      */
      $event = $this-&gt;_loadEventById($id);
  
      /*
      *Generate strings for the date, start, and end time
      */
      $ts = strtotime($event-&gt;start);
      $date = date('F d, Y' $ts);
      $start = date('g:ia', $ts);
      $end = date('g:ia', strtotime($event-&gt;end));
  
      /*
      *Generate and return the markup
      */
      return "&lt;h2&gt;$event-&gt;title&lt;/h2&gt;"
          . "\n\t&lt;p class=\"dates\"&gt;$date, $start&amp;mdash;$end&lt;/p&gt;"
          . "\n\t&lt;p&gt;$event-&gt;description&lt;/p&gt;";
  }
  </code></pre>
  
  <p>The code is much longer but for the sake of brevity and not having to burden anyone with long code I have copied out only the function where the error is coming from.</p>
  
  <p>What is going wrong?</p>