4

I am using PHPExcel for import data from excel file. but I find some problems where the data was dynamically repeated per sheets and I wanted to take the last sheet to process. Is there any idea or method to get the highest sheet index ?

elki42
  • 123
  • 1
  • 10

1 Answers1

11

Get the total number of sheets:

$sheetCount = $excelObj->getSheetCount();

The last sheet index will be:

$lastSheet = $sheetCount - 1;
Ben
  • 8,894
  • 7
  • 44
  • 80