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 This week: 1All time: 6,597 This week: 560Up
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: 411 Up48 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  
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  
 0%
Total:396
This week:1
All time:6,597
This week:560Up