1

我想读取没有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);
}

任何帮助都会很棒。

4

0 回答 0