<?php
/**
    Convert excel file to csv
*/
 
//Various excel formats supported by PHPExcel library
$excel_readers = array(
    'Excel5' ,
    'Excel2003XML' ,
    'Excel2007'
);
 
require_once('Classes/PHPExcel.php');
 
$reader = PHPExcel_IOFactory::createReader('Excel7');
$reader->setReadDataOnly(true);
 
$path = 'data.xlsx';
$excel = $reader->load($path);
 
$writer = PHPExcel_IOFactory::createWriter($excel, 'CSV');
$writer->save('data.csv');
 
echo 'File saved to csv format';
 
?>