PHP reads Excel and shows implementation code

Source: Internet
Author: User

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:

    1. 98 Line Logoff function OLERead() { } this function

    2. split(Replace theexplode(

    3. 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);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.