PHP code example of johngrogg / ics-parser

1. Go to this page and download the library: Download johngrogg/ics-parser 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/ */

    

johngrogg / ics-parser example snippets


    // Dump the whole calendar
    var_dump($ical->cal);

    // Dump every event
    var_dump($ical->events());
    

    // Dump a parsed event's start date
    var_dump($event->dtstart_array);

    // array (size=4)
    //   0 =>
    //     array (size=1)
    //       'TZID' => string 'America/Detroit' (length=15)
    //   1 => string '20160409T090000' (length=15)
    //   2 => int 1460192400
    //   3 => string 'TZID=America/Detroit:20160409T090000' (length=36)
    

$ical = new ICal($url, array('httpUserAgent' => 'A Different User Agent'));