You will want to do something like this, see examples.php if the formatting doesn't show up here. Then use the get_events() function in vCalendar to get an array of vEvent objects to do what you want with:
<?php
include("ical.php");
# Howto open an existing calendar for manipulation
$myicalfile1 = new ical_File("US32Holidays.ics");
# get the events from the first calendar in the file
$vevents = $myicalfile1->components->get_events();
# loop through calendar events
print "\n------------------\n";
foreach ($vevents as $key => $value) {
// do what you need with $value here
print $value->get_summary();
print " - ";
print $value->get_description();
print "\n";
}
?>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am making an iPhone application and i want to use libical to parse .ics dat from an .ics file OR from the URL location of a .ics file..
Firstly i want to know how i would go about using libical in my project?
Secondly i want to parse event names and their descriptions, so i that i can store the event names as variables..
I was wondering if this was possible using libical.. if so could someone please show me roughly how i may go about implementing this…
Any and all information will be very much appreciated!
Thank You For Reading
You will want to do something like this, see examples.php if the formatting doesn't show up here. Then use the get_events() function in vCalendar to get an array of vEvent objects to do what you want with:
<?php
include("ical.php");
# Howto open an existing calendar for manipulation
$myicalfile1 = new ical_File("US32Holidays.ics");
# get the events from the first calendar in the file
$vevents = $myicalfile1->components->get_events();
# loop through calendar events
print "\n------------------\n";
foreach ($vevents as $key => $value) {
// do what you need with $value here
print $value->get_summary();
print " - ";
print $value->get_description();
print "\n";
}
?>