PHP code example of j4wx / ics

1. Go to this page and download the library: Download j4wx/ics 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/ */

    

j4wx / ics example snippets


use J4Wx\ICS\Calendar;
use J4Wx\ICS\Event;

$cal = new Calendar();

$event = new Event();
$event->setStart(new DateTime("now"));
$event->setEnd(new DateTime("tomorrow"));
$event->setSummary("Big Party");

$cal->addEvent($event);

$event = new Event();
$event->setStart(new DateTime("yesterday"));
$event->setEnd(new DateTime("today"));
$event->setSummary("Another Party");
$event->setURL("https://www.github.com/J4Wx");

$cal->addEvent($event);

$cal->download();