PHP code example of makinuk / icalendar

1. Go to this page and download the library: Download makinuk/icalendar library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

makinuk / icalendar example snippets




$ical = new makinuk\ICalendar\ICalendar();
$event = new makinuk\ICalendar\ICalEvent();

$event->setUId("11223344")
        ->setStartDate(strtotime("+24 hours"))
        ->setEndDate(strtotime("+25 hours"))
        ->setSummary("Summary is here")
        ->setDescription("Description area is here")
        ->setLocation("Istanbul")
        ->setOrganizer(new makinuk\ICalendar\ICalPerson("Mustafa AKIN", "[email protected]"))
        ->setAlarm(new makinuk\ICalendar\ICalAlarm(0, 1, 10, 0));

$ical->addEvent($event);

//$ical->getCalendarText();
//$ical->show();
$ical->saveToFile(dirname(__FILE__).DIRECTORY_SEPARATOR."simpleEventAdd.ics");