Similar to Spreadsheet_Excel_Writer, Spreadsheet_Excel_Reader is a tool used to read Excel content. Excel data can be easily imported to data or used for other purposes. The Code is as follows :? Php calls Readerrequire_onceSpreadsheetExcelReaderreader.php; creates Reader $ datanew
Similar to Spreadsheet_Excel_Writer, Spreadsheet_Excel_Reader is a tool used to read Excel content. Excel data can be easily imported to data or used for other purposes. The Code is as follows :? Php // call Reader require_once 'spreadsheet/Excel/Reader/reader. php'; // create Reader $ data = new
Similar to Spreadsheet_Excel_Writer, Spreadsheet_Excel_Reader is a tool used to read Excel content.
Excel data can be easily imported to data or used for other purposes.
The following code:
SetOutputEncoding ('gb2312'); // read the Excel file $ data-> read ("c: \ test.xls "); // $ data-> sheets [0] ['numrows '] is the number of rows in Excel for ($ I = 1; $ I <= $ data-> sheets [0] ['numrows ']; $ I ++) {// $ data-> sheets [0] ['numcols'] indicates the number of Excel columns for ($ j = 1; $ j <= $ data-> sheets [0] ['numcols']; $ j ++) {// display the content of each cell echo $ data-> sheets [0] ['cells '] [$ I] [$ j] ;}}?>
In addition, due to the special nature of the date type, errors may occur during the value. You can set the Excel cell type to Text,
Read a date in text format. If you need a date character, you can use PHP to process it (strtotime () and date ()).