@@ -30,9 +30,9 @@ |
||
30 | 30 | $worksheet = $spreadsheet->getActiveSheet(); |
31 | 31 | |
32 | 32 | // Add some data |
33 | -$testDates = [[3, 15], [13, 15], [15, 15, 15], [3, 15, 30], |
|
34 | - [15, 15, 15], [5], [9, 15, 0], [9, 15, -1], |
|
35 | - [13, -14, -15], [0, 0, -1], |
|
33 | +$testDates = [[3, 15], [13, 15], [15, 15, 15], [3, 15, 30], |
|
34 | + [15, 15, 15], [5], [9, 15, 0], [9, 15, -1], |
|
35 | + [13, -14, -15], [0, 0, -1], |
|
36 | 36 | ]; |
37 | 37 | $testDateCount = count($testDates); |
38 | 38 |
@@ -30,10 +30,10 @@ |
||
30 | 30 | $worksheet = $spreadsheet->getActiveSheet(); |
31 | 31 | |
32 | 32 | // Add some data |
33 | -$testDates = ['26 March 2012', '29 Feb 2012', 'April 1, 2012', '25/12/2012', |
|
34 | - '2012-Oct-31', '5th November', 'January 1st', 'April 2012', |
|
35 | - '17-03', '03-2012', '29 Feb 2011', '03-05-07', |
|
36 | - '03-MAY-07', '03-13-07', |
|
33 | +$testDates = ['26 March 2012', '29 Feb 2012', 'April 1, 2012', '25/12/2012', |
|
34 | + '2012-Oct-31', '5th November', 'January 1st', 'April 2012', |
|
35 | + '17-03', '03-2012', '29 Feb 2011', '03-05-07', |
|
36 | + '03-MAY-07', '03-13-07', |
|
37 | 37 | ]; |
38 | 38 | $testDateCount = count($testDates); |
39 | 39 |
@@ -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 **/ |
@@ -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)); |
@@ -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); |
@@ -62,7 +62,7 @@ |
||
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
65 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
65 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
66 | 66 | /* Create a new Reader of the type defined in $inputFileType **/ |
67 | 67 | $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); |
68 | 68 |
@@ -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 | $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); |
37 | 37 | echo 'Loading all WorkSheets<br />'; |
38 | 38 | $reader->setLoadAllSheets(); |