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.
The following are the lines of the 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->_loadEventById($id);
/*
*Generate strings for the date, start, and end time
*/
$ts = strtotime($event->start);
$date = date('F d, Y' $ts);
$start = date('g:ia', $ts);
$end = date('g:ia', strtotime($event->end));
/*
*Generate and return the markup
*/
return "<h2>$event->title</h2>"
. "\n\t<p class=\"dates\">$date, $start—$end</p>"
. "\n\t<p>$event->description</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.
What is going wrong?