In php, can I use excel as a table to query and obtain data? In php, can I use excel as a table to query and obtain data?
Reply content:
In php, can I use excel as a table to query and obtain data?
PHPExcel
Https://github.com/ouardisoft/OSExcelBundle
Usage:
Read excel service
$ Excel = $ this-> get ('OS. excel ');
Open excel
$ Excel-> loadFile ([FILE_PATHNAME]);
Select sheet
$ Excel-> setActiveSheet ([INDEX_OF_SHEET]);
Sheet count
$ Excel-> getSheetCount ();
Sheet Name
$ Excel-> getSheetNames ();
Number of read rows
$ Excel-> getRowCount ();
Number of Fields read
$ Excel-> getColumnCount ();
Index of the last field
$ Excel-> getHighestColumn ();
Row data
$ Excel-> getRowData ([INDEX_OF_ROW]);
Cell Data
$ Excel-> getCellData ([INDEX_OF_ROW], [INDEX_OF_COLUMN]);
Read excel data as a PHP Array
$ Excel-> getSheetData ();
handle excel
I recommend this plug-in: PHPExcel
How do you query? Is the value obtained from the row and column information?