PHP Classes

PHP Calendar CSV Import to ICS (iCal): Convert calendar from CSV to ICS format

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 397 All time: 6,598 This week: 33Up
Version License PHP version Categories
csv2ics 1.0.3MIT/X Consortium ...5.0PHP 5, Time and Date, Conversion, Par...
Description 

Author

This class can convert CSV calendar file, as from Outlook, to ICS (iCal) format.

It takes calendar information exported read from the CSV format and generates the calendar in the ICS, or iCal, format.

The class uses regular expressions to extract column headers CSV file and map the values to the corresponding fields in the ICS format.

Innovation Award
PHP Programming Innovation award nominee
February 2016
Number 12


Prize: One subscription to the PDF edition of the PHP Architect magazine
Microsoft Outlook can export calendar events in the CVS format. However, some applications only support the ICS format for describing timed events.

This class can convert Outlook calendar events in CSV format and convert to files in the ICS format.

Manuel Lemos
Picture of Matthew Boyle
  Performance   Level  
Name: Matthew Boyle <contact>
Classes: 6 packages by
Country: United States United States
Age: ???
All time rank: 1963276 in United States United States
Week rank: 206 Up24 in United States United States Up
Innovation award
Innovation award
Nominee: 3x

Example

<?
date_default_timezone_set
('America/Detroit');
include(
"csv2ics.class.php");

$new = 'wings.ics';
$cal = new Csv2Ics('wings.csv',true);
$cal->convert($new);

echo
is_file($new) ? "success" : "fail";

?>


Details

This class takes the path of a CSV file as input. It has the option to include UID event identifier with a random string. The first row of the CSV is compared to regular expressions to select relevant data to transpose. The output file by default is named cal.ics, but a different name can be specified.

  Files folder image Files (4)  
File Role Description
Accessible without login Plain text file calendar.php Example sample script
Plain text file csv2ics.class.php Class Class
Accessible without login Plain text file readme.txt Doc. Documentation
Accessible without login Plain text file wings.csv Data example CSV

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:397
This week:0
All time:6,598
This week:33Up