The getSheet (I) of phpexcel can only read one page. how can I obtain the number of pages in an excel file? The getSheet of phpexcel can only read one page. how can I obtain the number of pages in an excel file ?, Count ?, // Obtain the number of worksheets $ sheetCount = $ PHPExcel-& gt; getSheetCount (); PHPc phpexcel's getSheet (I) can only read one page. how can I obtain the number of pages in an excel worksheet?
The getSheet of phpexcel can only read one page. how can I obtain the number of pages in an excel worksheet?
------ Solution --------------------
Count?
------ Solution --------------------
// Obtain the number of worksheets
$ SheetCount = $ PHPExcel-> getSheetCount ();
PHP code
CanRead ($ filePath) {$ PHPReader = new PHPExcel_Reader_Excel5 (); if (! $ PHPReader-> canRead ($ filePath) {echo 'no Excel file found! '; Return;} // functions that obtain all worksheet arrays without reading the entire Excel file. This function is useful, $ sheetNames = $ PHPReader-> listWorksheetNames ($ filePath); // read the Excel file $ PHPExcel = $ PHPReader-> load ($ filePath ); // Obtain the number of worksheets $ sheetCount = $ PHPExcel-> getSheetCount (); // select the first worksheet $ currentSheet = $ PHPExcel-> getSheet (0 ); // obtain the total number of columns $ allColumn = $ currentSheet-> getHighestColumn (); // obtain the total number of rows $ allRow = $ currentSheet-> getHighestRow (); // read data cyclically. the default encoding is utf8, which is converted to gbk output for ($ currentRow = 1; $ currentRow <= $ allRow; $ currentRow ++) {for ($ currentColumn = 'a'; $ currentColumn <= $ allColumn; $ currentColumn ++) {$ address = $ currentColumn. $ currentRow; echo iconv ('utf-8', 'gbk', $ currentSheet-> getCell ($ address)-> getValue ()). "\ t";} echo"
";}?>