Created
December 1, 2022 04:37
-
-
Save ydenissov/e23baea62cc0b36ecd661fd48007948a to your computer and use it in GitHub Desktop.
Parse XLSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function parseFile($inputFileName) { | |
$inputFileType = \PhpOffice\PhpSpreadsheet\IOFactory::identify($inputFileName); | |
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); | |
$spreadsheet = $reader->load($inputFileName); | |
$data = $spreadsheet->getActiveSheet()->toArray(); | |
// Remove header | |
unset($data[0]); | |
return $data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment