Home > Article > Backend Development > PHP reads Excel and displays the implementation code
This article mainly shares with you PHP reading Excel and shows the implementation code. I hope it can help everyone.
Use this tool. phpExcelReaderBecause it’s free
Write index.php
Introduce the 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'; //加载工具$data = new Spreadsheet_Excel_Reader("example.xls"); //将指定excel文件交给工具进行解析,并把结果赋给$data变量echo $data->dump(true,true);//输出结果,其中dump()函数的两个参数用于指定否需要显示excel文件中原有的行号和列号 ?>
Because this tool is from ancient times, there will be error prompts when setting it up directly in the php7 environment.
Modificationexcel_reader2.php
The following places are used to modify and block errors..
Line 98 logout function OLERead() { }
This function
puts split(
Replace with explode(
## in
index.php
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Spreadsheet_Excel_Reader has a deprecated constructor in D:\xampp\htdocs\pdfreader\excel_reader2.php on line 312Warning: gmdate() expects parameter 2 to be integer, float given in D:\xampp\htdocs\pdfreader\excel_reader2.php on line 79Warning: gmdate() expects parameter 2 to be integer, float given in D:\xampp\htdocs\pdfreader\excel_reader2.php on line 79
is as follows? Easy, come~
error_reporting(0);
Related recommendations:
##Detailed introduction Sample code for PHPExcel to read Excel time
php generates and reads excel files
The above is the detailed content of PHP reads Excel and displays the implementation code. For more information, please follow other related articles on the PHP Chinese website!