Create iCalendar Files Using PHP

Here is a nice PHP class that Creates iCalendar Files Using PHP. It generates ics files for importing events into iCalender compatible programs like Apple’s iCal or even as a webcal in PHPiCalendar. Note – this class requires PHP 5.0 or higher.

5 Responses to “Create iCalendar Files Using PHP”

  1. rob shaw said on October 3rd, 2004 at 4:19 pm

    i have been doing this for quite a while on our coldfusion intranet. All Events create an ics file on the fly and automatically open their ical and asks them what calendar they would like it in. Have code somewhere if anyone would like it….

  2. Spud said on October 18th, 2004 at 8:51 am

    Hi,

    I’m tryying to get the php5 version of this code to run.
    iCalendar version 2.001
    php version 5 RC2

    I keep running into weird isEmpty errors:

    Fatal error: Non-static method iCal::isEmpty() cannot be called statically in /usr/local/apache/htdocs/kk2005/ical/class.iCal.inc.php on line 915

    I don’t get this, beacuse in the iCal code the php native isEmpty function is called and it is not called as a method of the iCal object??!!

  3. flowctrl said on November 26th, 2004 at 3:32 pm

    I don’t see how this class can be for PHP5, given that version 2.001 has a date of 2003-07-16. Was PHP5 even out in 2003?

  4. Dana Drury said on January 11th, 2005 at 11:36 pm

    You need to move isEmpty out of the function getOutput() because you can’t have a nested function like that. It will try and redeclare it as soon as you send / create more than one ics file

  5. tatere said on February 8th, 2008 at 11:19 am

    Link is dead, file is gone, so sad.