Extended version is greater than or equal to 1.2.7;
PECL will prompt you to open the read function when installing, please type yes;
Function Prototype
sheetList(): array
Example
$excel = new \Vtiful\Kernel\Excel(['path' => './tests']);
// Build the sample file
$filePath = $excel
// First worksheet
->fileName('tutorial.xlsx', 'test1')
->header(['sheet'])
->data([['test1']])
// Second worksheet
->addSheet('test2')
->header(['sheet'])
->data([['test2']])
->output();
// Open the sample file
$sheetList = $excel->openFile('tutorial.xlsx')
->sheetList();
Foreach ($sheetList as $sheetName) {
echo 'Sheet Name:' . $sheetName . PHP_EOL;
// Get the worksheet data by the worksheet name
$sheetData = $excel
->openSheet($sheetName)
->getSheetData();
var_dump($sheetData);
}