// Create a new calendar and a new event $c = new SVCalendar(); $e = new SVEvent(); // Set some properties on the event. This includes setting "uid" -- some unique id number -- for // the event. You can use the id of an object in your database, a random number, etc. $e->summary = 'Workshop Number 1 Million'; $e->description = 'This is a cool workshop in which people do stuff.'; $e->uid = 1; $e->setStartDate('2008-06-15'); $e->setEndDate('2008-06-16'); $c->addEvent($e); // Print the calendar to the screen header('Content-type: text/text'); print($c->render()); // Or, save the calendar to an ics file file_put_contents('calendars/MyCal.ics', $c->render());