How to get value by column name in php spreadsheet-parser library?

I am using akeneo-labs spreadsheet parser library to extract data from an xlsx file.

use Akeneo\Component\SpreadsheetParser\SpreadsheetParser; $workbook = SpreadsheetParser::open('myfile.xlsx'); $myWorksheetIndex = $workbook->getWorksheetIndex('myworksheet'); foreach ($workbook->createRowIterator($myWorksheetIndex) as $rowIndex => $values) { var_dump($rowIndex, $values); } 

Actually, you can get the value by the column index in the loop, is it possible to get the value by the column name instead?

+9
source share
1 answer

it is possible to use another package, as suggested, solves your problem. also you can use array_column https://www.php.net/manual/en/function.array-column.php

0
source

Source: https://habr.com/ru/post/1264245/


All Articles