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. I know this particular tech tip will have limited usage among Digital Media Minute readers who do graphic design and the like, but I try not to shy away from geekier programming tips like juicy classes in PHP for example, because I know that some readers will benefit.
By the way, I have an outstanding offer for all readers to help me steer the direction of this blog towards information, tutorials, tips and tricks in areas in which you are interested.


{ 5 comments… read them below or add one }
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….
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??!!
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?
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
Link is dead, file is gone, so sad.