PHPExcel is a pure PHP library for reading and writing spreadsheet files and CodeIgniter is one of the well known PHP MVC Framework.
Step 1: Download and setup CodeIgniter.(download it here: https://www.codeigniter.com/)
Step 2: Download PHPExcel.(download it here: https://github.com/PHPOffice/PHPExcel)
Step 3: Unzip or extract the downloaded PHPExcel lib files and copy Class directory inside files to application/third-party directory(folder).
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
require_once APPPATH."/third_party/PHPExcel-1.8/Classes/PHPExcel.php";
require_once APPPATH."/third_party/PHPExcel-1.8/Classes/PHPExcel/IOFactory.php";
class Excel extends PHPExcel {
public function __construct() {
parent::__construct();
}
}
?>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$autoload['libraries'] = array('database','session','form_validation','excel');
?>