You are here

private function FeedsExcelParser::getHeaders in Feeds Excel 7.2

Parse first row as headers.

File

./FeedsExcelParser.inc, line 60
Contains FeedsExcelParser.

Class

FeedsExcelParser
Provides feeds parser class for Excel files.

Code

private function getHeaders() {
  $headers = array();
  $this->reader
    ->setReadFilter(new FeedsExcelParserIReadFilter(1, 1));
  foreach ($this->reader
    ->load($this->file_path)
    ->getSheet()
    ->getRowIterator() as $row) {
    foreach ($row
      ->getCellIterator() as $cell_index => $cell) {
      $headers[$cell_index] = filter_xss($cell
        ->getValue());
    }
  }
  return $headers;
}