1. Go to this page and download the library: Download clubmaster/vobject 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/ */
clubmaster / vobject example snippets
use Sabre\VObject;
$card = VObject\Reader::read($data);
echo $card->FN;
$dateTime = new \DateTime('2012-08-07 23:53:00', new DateTimeZone('Europe/Amsterdam'));
$event->DTSTART->setDateTime($dateTime, VObject\Property\DateTime::DATE);
use Sabre\VObject;
$calendar = VObject\Reader::read($data);
$calendar->expand(new DateTime('2012-01-01'), new DateTime('2012-12-31'));
foreach($calendar->VEVENT as $event) {
echo $event->DTSTART->getDateTime()->format(\DateTime::ATOM);
}
// We're giving it the calendar object. It's also possible to specify multiple objects,
// by setting them as an array.
//
// We must also specify a start and end date, because recurring events are expanded.
$fbGenerator = new VObject\FreeBusyGenerator(
new DateTime('2012-01-01'),
new DateTime('2012-12-31'),
$calendar
);
// Grabbing the report
$freebusy = $fbGenerator->result();
// The freebusy report is another VCALENDAR object, so we can serialize it as usual:
echo $freebusy->serialize();