-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimport-excel.php
37 lines (24 loc) · 899 Bytes
/
import-excel.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/*
*@author mucheru
*
* Generate xlsforms from serialized form data
* (http://www.sitepoint.com/generate-excel-files-charts-phpexcel/)
* (http://phpexcel.codeplex.com/discussions/249093)
*/
require('lib/PHPExcel-1.8/Classes/PHPExcel.php');
require('lib/PHPExcel-1.8/Classes/PHPExcel/IOFactory.php');
$inputFileName = "XLSForms/multi-contributor-test.xlsx";
$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
$output = $objPHPExcel;
//var_dump($output);
$objReader = PHPExcel_IOFactory::createReader( 'Excel2007' );
$objReader->setLoadSheetsOnly( $inputFileName); // Load specific sheet
$objPHPExcel = $objReader->canRead( $inputFileName );
$objPHPExcel = $objReader->load( $inputFileName );
// Prepare loop to extract values from cells
$worksheet = $objPHPExcel->getActiveSheet();
$cell = $worksheet->getCell( "A1" );
$value = $cell->getValue();
var_dump($value);
?>