Skip to content

Instantly share code, notes, and snippets.

@sunil-bagde
Created October 17, 2018 20:05
Show Gist options
  • Save sunil-bagde/731b9280a3026c1ce1112d4dd7c01cdd to your computer and use it in GitHub Desktop.
Save sunil-bagde/731b9280a3026c1ce1112d4dd7c01cdd to your computer and use it in GitHub Desktop.
// https://github.com/PHPOffice/PhpSpreadsheet
$inputFileName = public_path('example2.xls');
$reader = new Xls();
$spreadsheet = $reader->load($inputFileName);
$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true);
print_r($sheetData);
$inputFileName = public_path('example2.xlsx');
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
$spreadsheet = $reader->load( $inputFileName);
$sheetData = $spreadsheet->getActiveSheet()->toArray();
print_r($sheetData);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment