# You should load an ICAL file into the variable $contents before including this code

$regex = "/BEGIN:VEVENT.*?DTSTART:[^:]*:([^\s]*).*?SUMMARY:([^\n]*).*?END:VEVENT/is";
preg_match_all($regex, $contents, $matches, PREG_SET_ORDER);

 
for($i=0;$i<sizeof($matches);++$i) {
   // $matches[$i][1] holds the entire ICAL event 
   // $matches[$i][1] holds the time
   // $matches[$i][2] holds the summary
}

