Skip to content

Instantly share code, notes, and snippets.

View sdkuck's full-sized avatar

Steven Kuck sdkuck

  • Info Tech
  • Gainesville, FL
View GitHub Profile
@clouddueling
clouddueling / parse.php
Created March 27, 2013 14:08
parse an excel file in php with laravel
// Turn XLS file into an array
require_once 'bundles/laravel-phpexcel/PHPExcel/IOFactory.php';
$objPHPExcel = PHPExcel_IOFactory::load($file_path);
$rows = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
// get the column names
$xls_fields = isset($rows[1]) ? $rows[1] : array();
if (! empty($xls_fields))
unset($rows[1]);