@@ -30,7 +30,7 @@ |
||
30 | 30 | $worksheet = $spreadsheet->getActiveSheet(); |
31 | 31 | |
32 | 32 | // Add some data |
33 | -$testDates = ['3:15', '13:15', '15:15:15', '3:15 AM', '3:15 PM', '5PM', '9:15AM', '13:15AM', |
|
33 | +$testDates = ['3:15', '13:15', '15:15:15', '3:15 AM', '3:15 PM', '5PM', '9:15AM', '13:15AM', |
|
34 | 34 | ]; |
35 | 35 | $testDateCount = count($testDates); |
36 | 36 |
@@ -30,11 +30,11 @@ |
||
30 | 30 | $worksheet = $spreadsheet->getActiveSheet(); |
31 | 31 | |
32 | 32 | // Add some data |
33 | -$testDates = [[2012, 3, 26], [2012, 2, 29], [2012, 4, 1], [2012, 12, 25], |
|
34 | - [2012, 10, 31], [2012, 11, 5], [2012, 1, 1], [2012, 3, 17], |
|
35 | - [2011, 2, 29], [7, 5, 3], [2012, 13, 1], [2012, 11, 45], |
|
36 | - [2012, 0, 0], [2012, 1, 0], [2012, 0, 1], |
|
37 | - [2012, -2, 2], [2012, 2, -2], [2012, -2, -2], |
|
33 | +$testDates = [[2012, 3, 26], [2012, 2, 29], [2012, 4, 1], [2012, 12, 25], |
|
34 | + [2012, 10, 31], [2012, 11, 5], [2012, 1, 1], [2012, 3, 17], |
|
35 | + [2011, 2, 29], [7, 5, 3], [2012, 13, 1], [2012, 11, 45], |
|
36 | + [2012, 0, 0], [2012, 1, 0], [2012, 0, 1], |
|
37 | + [2012, -2, 2], [2012, 2, -2], [2012, -2, -2], |
|
38 | 38 | ]; |
39 | 39 | $testDateCount = count($testDates); |
40 | 40 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | echo '<b>Custom Properties: </b><br />'; |
42 | 42 | /* Loop through the list of custom properties **/ |
43 | 43 | foreach ($customPropertyList as $customPropertyName) { |
44 | - echo '<b>',$customPropertyName,': </b>'; |
|
44 | + echo '<b>', $customPropertyName, ': </b>'; |
|
45 | 45 | /* Retrieve the property value **/ |
46 | 46 | $propertyValue = $spreadsheet->getProperties()->getCustomPropertyValue($customPropertyName); |
47 | 47 | /* Retrieve the property type **/ |
@@ -32,7 +32,7 @@ |
||
32 | 32 | // $inputFileType = 'Gnumeric'; |
33 | 33 | $inputFileName = './sampleData/example1.xls'; |
34 | 34 | |
35 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
35 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
36 | 36 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); |
37 | 37 | echo 'Turning Formatting off for Load<br />'; |
38 | 38 | $objReader->setReadDataOnly(true); |
@@ -30,11 +30,11 @@ |
||
30 | 30 | |
31 | 31 | $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); |
32 | 32 | $inputFileName = array_shift($inputFileNames); |
33 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #1 using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
33 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' into WorkSheet #1 using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
34 | 34 | $spreadsheet = $reader->load($inputFileName); |
35 | 35 | $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); |
36 | 36 | foreach ($inputFileNames as $sheet => $inputFileName) { |
37 | - echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #',($sheet + 2),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
37 | + echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' into WorkSheet #', ($sheet + 2), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
38 | 38 | $reader->setSheetIndex($sheet + 1); |
39 | 39 | $reader->loadIntoExisting($inputFileName, $spreadsheet); |
40 | 40 | $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | // $inputFileType = 'Gnumeric'; |
33 | 33 | $inputFileName = './sampleData/example1.xls'; |
34 | 34 | |
35 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
35 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
36 | 36 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); |
37 | 37 | echo 'Turning Formatting off for Load<br />'; |
38 | 38 | $objReader->setReadDataOnly(true); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | // $inputFileType = 'Gnumeric'; |
33 | 33 | $inputFileName = './sampleData/example1.xls'; |
34 | 34 | |
35 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
35 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
36 | 36 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); |
37 | 37 | echo 'Turning Formatting off for Load<br />'; |
38 | 38 | $objReader->setReadDataOnly(true); |
@@ -26,17 +26,17 @@ |
||
26 | 26 | $inputFileName = './sampleData/example1.tsv'; |
27 | 27 | |
28 | 28 | $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); |
29 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #1 using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
29 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' into WorkSheet #1 using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
30 | 30 | $reader->setDelimiter("\t"); |
31 | 31 | $spreadsheet = $reader->load($inputFileName); |
32 | 32 | $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); |
33 | 33 | |
34 | 34 | echo '<hr />'; |
35 | 35 | |
36 | -echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />'; |
|
36 | +echo $spreadsheet->getSheetCount(), ' worksheet', (($spreadsheet->getSheetCount() == 1) ? '' : 's'), ' loaded<br /><br />'; |
|
37 | 37 | $loadedSheetNames = $spreadsheet->getSheetNames(); |
38 | 38 | foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { |
39 | - echo '<b>Worksheet #',$sheetIndex,' -> ',$loadedSheetName,' (Formatted)</b><br />'; |
|
39 | + echo '<b>Worksheet #', $sheetIndex, ' -> ', $loadedSheetName, ' (Formatted)</b><br />'; |
|
40 | 40 | $spreadsheet->setActiveSheetIndexByName($loadedSheetName); |
41 | 41 | $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); |
42 | 42 | var_dump($sheetData); |