calendar/icsfile

这个简单的类生成一个.ics文件。

8.0.0 2024-03-22 17:07 UTC

README

SensioLabsInsight

这个简单的类生成一个*.ics文件。需要php >= 8.1.0

使用方法

<?php

require_once 'vendor/autoload.php';

use Ical\Ical;
use Ical\IcalendarException;
try {
        $ical = (new Ical())->setAddress('Paris')
                ->setDateStart(new \DateTime('2014-11-21 15:00:00'))
                ->setDateEnd(new \DateTime('2014-11-21 16:00:00'))
                ->setDescription('wonder description')
                ->setSummary('Running')
                ->setOrganizer('foo@bar.fr') //optional
                ->setFilename(uniqid());
                ->setSequence(2) //Number of updates, the default is at 1, optional
            $ical->addHeader();

    echo $ical->getICAL();          

        } catch (IcalendarException $exc) {
            echo $exc->getMessage();
}