Remove obsolete $obj prefix in cod sample

This commit is contained in:
Adrien Crivelli
2016-12-03 22:32:54 +09:00
parent 90da50f3c7
commit 17d1976526
24 changed files with 389 additions and 389 deletions
+4 -4
View File
@@ -28,15 +28,15 @@ include 'PHPExcel/IOFactory.php';
$inputFileType = 'CSV';
$inputFileNames = ['./sampleData/example1.csv', './sampleData/example2.csv'];
$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
$inputFileName = array_shift($inputFileNames);
echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #1 using IOFactory with a defined reader type of ',$inputFileType,'<br />';
$spreadsheet = $objReader->load($inputFileName);
$spreadsheet = $reader->load($inputFileName);
$spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME));
foreach ($inputFileNames as $sheet => $inputFileName) {
echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #',($sheet + 2),' using IOFactory with a defined reader type of ',$inputFileType,'<br />';
$objReader->setSheetIndex($sheet + 1);
$objReader->loadIntoExisting($inputFileName, $spreadsheet);
$reader->setSheetIndex($sheet + 1);
$reader->loadIntoExisting($inputFileName, $spreadsheet);
$spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME));
}