phpExcelReader realize Excel Analysis

I. Introduction

PHP-ExcelReader Excel xsl file is a read the contents of a PHP class.

It's download site: http://sourceforge.net/projects/phpexcelreader/

File Name: phpExcelReader.zip

Contains two essential files: oleread.inc, reader.php. Other file is an application example, the readme files, etc.

Second, document use

First of all, including reader class file: require_once "reader.php";

Create a new instance of: $ xl_reader = new Spreadsheet_Excel_Reader ();

Read Excel file information: $ xl_reader-> read ("filename.xls");

It will export the Excel file can identify all of the data stored in an object. Data is stored in two arrays, there is no available method / function to access the data. Can be as simple as following the use of an array name.

sheets to read into the object array contains large amounts of data. It will export the Excel file can identify all of the data stored in a 2-dimensional array $ xl_reader-> sheets [x] [y]. table for the document x Number, y is one of the following parameters:

l numRows - int - the number of rows the table

For example: $ rows = $ xl_reader-> sheets [0] ['numRows']

l numCols - int - the number of columns the table

For example: $ cols = $ xl_reader-> sheets [0] ['numCols']

l cells - array - the actual content of the table. A [row] [column] format of 2-dimensional array

For example: $ cell_2_4 = $ xl_reader-> sheets [0] ['cells'] [2] [4] / / row 2, column 4 data

l cellsInfo - array - a table of information of different data types. Each of which contains a table of raw data and type. This array contains two parts: raw - raw data form; type - data type.

Note: Only non-text data.

For example: $ cell_info = $ xl_reader [0] ['cellsInfo'] [2] [4]

$ Cell_info ['raw'] is the raw data from the cell

$ Cell_info ['type'] is the data type

$ Xl_reader-> sheets array example:

Array

(

[0] => Array

(

[Maxrow] => 0

[Maxcol] => 0

[NumRows] => 30

[NumCols] => 12

[Cells] => Array

(

[1] => Array

(

[1] => Date

[2] => Donor / Title

[3] => amount

[4] => the original donation amount

[5] => Receipt No.

[6] => receipts rise

[7] => Sex

[8] => use

[9] => address

[10] => Contact / Phone

[11] => implementation of the case

[12] => Notes

)

[2] => Array

(

[1] => 2007/06/02

[2] => Rong-Hua Qin Wei Qinglian / Group

[3] => 300000

[4] => 45

[5] => 502

[6] => Ningbo Accor Machinery Co., Ltd. China

[7] => couples

[8] => test

[10] => Hu Aihua Secretary / 13566518117

[11] => 2008-9 love 2008-12 school 1 250 000 1 250 000 primary school love pearl 2009-9 Class 2 Class Balance 250,000 750,000 yuan

[12] => Notes

)

)

[CellsInfo] => Array

(

[2] => Array

(

[1] => Array

(

[Raw] => 1180742400

[Type] => date

)

[3] => Array

(

[Raw] => 300000

[Type] => number

)

[4] => Array

(

[Raw] => 45

[Type] => unknown

)

[5] => Array

(

[Raw] => 502

[Type] => unknown

)

)

)

)

[1] => Array

(

[Maxrow] => 0

[Maxcol] => 0

[NumRows] => 0

[NumCols] => 0

)

[2] => Array

(

[Maxrow] => 0

[Maxcol] => 0

[NumRows] => 0

[NumCols] => 0

)

)

boundsheets array contains objects of other information, an array indexed by workbook. The second index name: $ xl_reader-> boundsheets [i] ['name'] returns the first name of the table i tables

For example: $ sheetname = $ xl_reader-> boundsheets [0] ['name']; / / name of the first sheet

$ Xl_reader-> boundsheets array example:

Array

(

[0] => Array

(

[Name] => Sheet1

[Offset] => 3054

)

[1] => Array

(

[Name] => Sheet2

[Offset] => 6147

)

[2] => Array

(

[Name] => Sheet3

[Offset] => 6410

)

)

PHP-ExcelReader only support BIFF7, BIFF8 format. Including Excel95 to Excel2003. But does not include Excel5.0 and prior versions. In fact Excel XP and Excel 2003 use BIFF8X BIFF8 format is an extension. All added features may not be PHP-ExcelReader. Lock support. Otherwise, it can only run Excel XP/2003 files.

分类:PHP 时间:2010-05-13 人气:231
分享到:
blog comments powered by Disqus

相关文章

  • Oracle objects - abstract data types. Variable array. Nested table. Object tables and object views 2010-02-23

    Oracle Database is RDBMS (relational database) is ORDBMS (object-oriented database). RDBMS: When reusing a function, will need to be compiled; ORDBMS: allows you to define object types; in a relational database to store complex business models; devel

  • C / C + + basic data types [change] 2010-03-12

    Reprinted from: http://blog.pfan.cn/xman/33807.html Learn C and C + +, and MFC / Windows, then C #, in which many types of data, derived from the basic types typedef type is also more than N. Basic data types known to express the real problem is that

  • SqlServer in decimal (numeric). Float and real data types difference 2011-04-14

    http://blog.csdn.net/zwxrain/archive/2009/03/20/4006431.aspx decimal data type can store up to 38 numbers, all numbers are able to put the right of the decimal point. decimal data type stores an accurate (exact) number of expressions; approximations

  • Oracle 9i provides scalar data types table 2010-09-09

    Oracle 9i provides a total of 16 species of scalar data types table: name meaning Char used to describe the fixed length of character data, length <= 2000 bytes varchar2 used to describe the variable length character data, length <= 4000 bytes nchar

  • Oracle data types and storage (a) the character type 2010-08-26

    Oracle data types and storage methods Overview by example, a comprehensive and in-depth analysis of oralce basic data types and their storage. To ORACLE 10G basis, introduce oralce 10g introduces new data types. Oracle data types allow you to have a

  • Common database of basic data types 2011-02-17

    Microsoft Access data types Data type storage Text for text or text and numbers. Up to 255 characters. Memo Memo for larger amounts of text. Store up to 65,536 characters. Note: You can sort of memo fields. However, they are searchable. Byte Enable 0

  • sqlite data types keywords and create Modify Delete Data Sheet 2011-03-07

    General data using a fixed static data types, and SQLite uses dynamic data types, according to the value stored automatically determine. SQLite has the following five data types: 1.NULL: null. 2.INTEGER: signed integer, the specific range of numbers

  • Complex data types Oracle 10g pl / sql collection of learning six - the index table. Nested table. Variable-length array 2010-11-12

    - Oracle 10g complex data types pl / sql collection, the collection can be divided into index tables, nested tables, variable-length array - 1, the index table (subscript no length limit, and can be negative) - In 9i before the definition of the inde

  • Composite data types Oracle 10g pl / sql collection of learning six - the index table. Nested tables. Variable-length array 2010-11-12

    --Oracle 10g A composite data type pl/sql collection , The collection can be divided into the nested table index table. . Variable-length arrays --1. Index table ( Subscript is no limit on the length, and can also be negative ) -- Before the 9i , Whe

  • SQL Server data types 2010-07-16

    SQL Server Standard data types data type Type Description bit integer whose value can only be 0,1 or NULL, such as Yes or No int integer can be stored to the database in almost all numerical data smallint integer often limited to some specific range

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.371 (s). 12 q(s)