Skip to content
Advertisement

Subscription Calendar URL in PHP

Hi, I am working on a project based on event management where each user store there event detail with start and end date. Now I want a feature to subscribe to the desktop application (Outlook, Ical for apple and google calendar), so that any new event save in the database it automatically sync to the desktop application. What is the best approach to achieve this functionality?

Advertisement

Answer

Here’s sample code for generating a single event iCal output:

JavaScript

Here’s the function that formats date objects to iCal format:

JavaScript

Before outputting the content, you need to set appropriate headers:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement