aVadim483 / fast-excel-reader

Lightwight and very fast XLSX Excel Spreadsheet Reader in PHP
MIT License
63 stars 16 forks source link

row data to be indexed by number (0, 1, 2, 3) #4

Closed MohmmadQunibi closed 2 years ago

MohmmadQunibi commented 2 years ago

I saw that there is a flag to set the index for each column from the first row, it's a great option, but for my use case, and I believe many people have the same case, switching from spreadsheet to this library would be a little bit annoying since I need to check for every place the function is called to change the index call from (ex. $data[2][0] to $data[2]['A'])

[EDIT] I found a way to do it, by setting the column for each one by 0, 1, 2, 3 example $columnKeys = ['A' => 0, 'B' => 1, 'C' => 2, 'D' => 3, 'E' => 4, 'F' => 5, 'G' => 6, 'H' => 7, 'I' => 8, 'J' => 9, 'K' => 10]; ... if this can be an option, I believe it would be better

thank you for this wonderful library

aVadim483 commented 2 years ago

Ok, from v.1.4.0 you can use

$excel->readRows(Excel::KEYS_ZERO_BASED));

and all keys (rows and columns) will be started from 0

Also, available other options (see README.md)