This article mainly share with you PHP read Excel and show implementation code, hope to help everyone.
Use this tool. Phpexcelreader because it's free.
Write the index.php
import resource file excel_reader2.php
.
<?phperror_reporting (e_all ^ e_notice); error_reporting (0);//error_reporting (e_all ^ e_notice); Require_once ' Excel_reader2.php '; Load Tool $data = new Spreadsheet_excel_reader ("Example.xls"); Give the specified Excel file to the tool for parsing and assign the result to the $data variable echo $data->dump (true,true);//output result, where dump () The two parameters of the function specify no need to display the line and column numbers in the Excel file?>
Because this tool is something of an ancient age, the PHP7 environment is directly tied up with false hints.
Modify excel_reader2.php
The following several places to modify and mask errors:
98 Line Logoff function OLERead() { }
this function
split(
Replace theexplode(
On the index.php
above mask error option ' error_reporting (0);
Modify the above or a little warning, as follows
Deprecated:methods with the same name as their class won't is constructors in a future version of PHP; Spreadsheet_excel_reader have a deprecated constructor in D:\xampp\htdocs\pdfreader\excel_reader2.php on line 312Warning : Gmdate () expects parameter 2 to BES integer, float given in D:\xampp\htdocs\pdfreader\excel_reader2.php on line 79Warning : Gmdate () expects parameter 2 to BES integer, float given in D:\xampp\htdocs\pdfreader\excel_reader2.php on line 79
What do we do? Easy, come on ~
error_reporting (0);