Upload Excel in MySQL using Phpspreadsheet in CodeIgniter

Описание к видео Upload Excel in MySQL using Phpspreadsheet in CodeIgniter

In this video , you will be able to upload excel using phpspreadsheet in CodeIgniter.

Steps:
Create a form and input type file
In your controller, get file and check for extension
pathinfo - get the file extension (PATHINFO_EXTENSION)

For csv - $reader= new \PhpOffice\PhpSpreadsheet\Reader\Csv();
For xls - $reader= new \PhpOffice\PhpSpreadsheet\Reader\Xls();
For xlsx - $reader= new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();

For loading the file use reader load function
getActiveSheet - for getting the active worksheet of excel
toArray - fetch the sheet data into array

create an array for inserting into database

insert_batch - for inserting batch data into database

Install php spreadsheet in codeigniter, if you have not watched it please check it out:
   • Installation of PhpSpreadsheet in Cod...  

Create excel
   • Create Excel Using PHPSpreadsheet in ...  

Documentation:
https://phpspreadsheet.readthedocs.io...

Starting hello world:
https://phpspreadsheet.readthedocs.io...

Code Link:
https://github.com/sushma-singh-yadav...

Upload Excel in MySQL using Phpspreadsheet in CodeIgniter

#codeigniter #knowledgethrusters

Комментарии

Информация по комментариям в разработке