S
S
Sergey Erin2020-02-24 16:34:47
PHP
Sergey Erin, 2020-02-24 16:34:47

How to parse excel headers with php?

When loading a regular excel file, I get the headers like this

$headers = $list
    ->rangeToArray(
      'A1:'.$list->getHighestColumn().'1',
      null,
      false,
      false,
      true
    );

But often managers upload files in which headers start only on 7, 10 lines, and at the top there is, for example, a logo and contacts. How to get headers in such cases?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nokimaro, 2020-02-24
@nokimaro

There is no universal solution in this case. Since all you operate on is cells, rows, columns.
Here only apply logic from the category, but how does a person determine where the headers and data begin?
For example, that this is an N-sequence of cells in a row in bold without merging followed by a data stream in the same format, and so on.
And based on this, we are already writing an algorithm in PHP.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question