PHP Classes

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

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 396 All time: 6,600 This week: 206Up
Version License PHP version Categories
csv2ics 1.0.3MIT/X Consortium ...5.0PHP 5, Time and Date, Conversion, Par...


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: 1963275 in United States United States
Week rank: 289 Up26 in United States United States Up
Innovation award
Innovation award
Nominee: 3x



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

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



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  
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

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:6,600
This week:206Up