我想在没有createRowIterato接口的情况下读取第一行作为第一行,在XLSX文件中,属于我的数据库表字段。所以我想首先阅读它们并希望将它放在字段数组中。
我在第一级使用示例代码:
$workbook = SpreadsheetParser::open('myfile.xlsx');
$myWorksheetIndex = $workbook->getWorksheetIndex('sheet1');
//MY REQUIREMENT
//Here I want to get first row as they will be treated as my table fields.
foreach ($workbook->createRowIterator($myWorksheetIndex) as $rowIndex => $values) {
var_dump($rowIndex, $values);
}
任何帮助都会很棒。