-
Notifications
You must be signed in to change notification settings - Fork 0
RohanPhpDev/Codeigniter-CSV-Generation-Library
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Codeigniter CSV Library What it does: Takes an active record result or a data array and creates an csv file. Also, it's capable of passing custom titles and filename. Nothing super special but it gets the job done! Instructions: Just drop it in your libraries folder. To create from database result <?php public function export() { $this->load->library('excel'); $record = $this->db->get('dbtable'); $this->excel->filename = 'Demo'; $this->excel->make_from_db($record); //if you want to custome header then pass an array as third parameter $custome_header=['Title1','Title2']; $this->excel->make_from_db($record,$custome_header); } ?> To Create from a custom array <?php public function export() { $titles = array(' 'field1', 'field2', 'field3' '); $array = array(); for ($i = 0; $i <= 100; $i++) { $array[] = array($i, $i+1, $i+2); } $this->excel->make_from_array($titles, $array); } ?>
About
This is simple library to generate csv files from database or from arrary with custome and db hearders
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published