Phpexcelreader super easy to use

Source: Internet
Author: User
Tags php class

Phpexcelreader super easy to use

The PHP class can be downloaded to the official website: http://www.codeplex.com/PHPExcel, the downloaded files can not be used directly to see the following remarks.

Note:

1, to change the oleread.inc to oleread.php, modify the file name.

2, to be reader.php in the 31st paragraph code: require_once ' spreadsheet/excel/reader/oleread.php ';

Change to the file path of note 1: require_once ' oleread.php ' (assuming oleread.php and reader.php are in the same directory)

3. When an error code appears:deprecated:assigning The return value of new by reference is Deprecated. Your PHP version is greater than 5.3, and 5.3 does not support the "=&" symbol, which supports the "=" symbol, so replace the "=&" symbol in the reader.php file with the "=" symbol.

4, self-jxlrwtest.xls files have errors, you need to create a new XLS file yourself to test

5, some other garbled what problem, here does not explain, look at the title you understand (simple use)

Code features: Show all data for this XLS file

#Test.xls the xls file to import

#$data->sheets[0][' numrows ') gets the maximum number of rows

#$data->sheets[0][' numcols ') gets the maximum number of columns

#$data->sheets[0][' cells ' [$i] [$j] get data for a cell

<?phprequire_once ' reader.php ';
$data = new Spreadsheet_excel_reader (); $data->read ('test.xls');
$data->sheets[0][' numrows ']; $i + +) { $data->sheets[0][' numcols ']; $j + +) { echo "\" ". $data->sheets[0][' cells ' [$i] [$j]. " \","; } echo "<br/>";}

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.