PHPSpreadsheet:如何获取加载的行数?
2022-08-30 22:43:10
如何找出使用方法加载了多少行?PHPSpreadsheet\Reader\Xlsx::load()
我也找不到在电子表格或工作表类中获取行计数的方法(或属性)。
顺便说一句,我正在使用以下代码:
$filename = 'test.xlsx';
$inputFileType = \PhpOffice\PhpSpreadsheet\IOFactory::identify($filename);
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
$reader->setReadDataOnly(true);
$reader->setLoadSheetsOnly($sheet);
$this->spreadsheet = $reader->load($filename);
$this->worksheet = $this->spreadsheet->getActiveSheet();