sabre-io / vobject

:date: The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects
http://sabre.io/vobject/
BSD 3-Clause "New" or "Revised" License
570 stars 125 forks source link

Parse an iCal calendar, how to get all events? #650

Closed laptop-doug closed 5 months ago

laptop-doug commented 5 months ago

I tried the 'basic parsing example' from the docs. also tried ->children().
$vcalendar->VEVENT gave me one basically empty array. Children() gave me a bigger array, but no events.

I have verified that the proper string, from the ical is getting to the $vcalendar = VObject\Reader::read($icalData);

gharlan commented 5 months ago

foreach ($vcalendar->VEVENT as $vevent) { ... }

With $vcalendar->VEVENT you get the first VEVENT component and at the same time an iterator for all VEVENT components.

laptop-doug commented 5 months ago

got it, thank you.