@@ -140,8 +140,8 @@ |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | $hashTablesArray = ['stylesConditionalHashTable', 'fillHashTable', 'fontHashTable', |
143 | - 'bordersHashTable', 'numFmtHashTable', 'drawingHashTable', |
|
144 | - 'styleHashTable', |
|
143 | + 'bordersHashTable', 'numFmtHashTable', 'drawingHashTable', |
|
144 | + 'styleHashTable', |
|
145 | 145 | ]; |
146 | 146 | |
147 | 147 | // Set HashTable variables |
@@ -1147,14 +1147,14 @@ |
||
1147 | 1147 | |
1148 | 1148 | // Pack the main data stream |
1149 | 1149 | $data = pack('vvvv', $row1, $row2, $col1, $col2) . |
1150 | - $unknown1 . |
|
1151 | - $link_type . |
|
1152 | - $unknown2 . |
|
1153 | - $up_count . |
|
1154 | - $dir_short_len . |
|
1155 | - $dir_short . |
|
1156 | - $unknown3 . |
|
1157 | - $stream_len; /*. |
|
1150 | + $unknown1 . |
|
1151 | + $link_type . |
|
1152 | + $unknown2 . |
|
1153 | + $up_count . |
|
1154 | + $dir_short_len . |
|
1155 | + $dir_short . |
|
1156 | + $unknown3 . |
|
1157 | + $stream_len; /*. |
|
1158 | 1158 | $dir_long_len . |
1159 | 1159 | $unknown4 . |
1160 | 1160 | $dir_long . |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $testDates = [[3, 15], [13, 15], [15, 15, 15], [3, 15, 30], |
34 | 34 | [15, 15, 15], [5], [9, 15, 0], [9, 15, -1], |
35 | 35 | [13, -14, -15], [0, 0, -1], |
36 | - ]; |
|
36 | + ]; |
|
37 | 37 | $testDateCount = count($testDates); |
38 | 38 | |
39 | 39 | $worksheet->fromArray($testDates, null, 'A1', true); |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | $worksheet->setCellValue('E' . $row, '=D' . $row); |
44 | 44 | } |
45 | 45 | $worksheet->getStyle('E1:E' . $testDateCount) |
46 | - ->getNumberFormat() |
|
47 | - ->setFormatCode('hh:mm:ss'); |
|
46 | + ->getNumberFormat() |
|
47 | + ->setFormatCode('hh:mm:ss'); |
|
48 | 48 | |
49 | 49 | echo '<hr />'; |
50 | 50 |
@@ -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 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | '2012-Oct-31', '5th November', 'January 1st', 'April 2012', |
35 | 35 | '17-03', '03-2012', '29 Feb 2011', '03-05-07', |
36 | 36 | '03-MAY-07', '03-13-07', |
37 | - ]; |
|
37 | + ]; |
|
38 | 38 | $testDateCount = count($testDates); |
39 | 39 | |
40 | 40 | for ($row = 1; $row <= $testDateCount; ++$row) { |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | $worksheet->getStyle('C1:C' . $testDateCount) |
47 | - ->getNumberFormat() |
|
48 | - ->setFormatCode('yyyy-mmm-dd'); |
|
47 | + ->getNumberFormat() |
|
48 | + ->setFormatCode('yyyy-mmm-dd'); |
|
49 | 49 | |
50 | 50 | echo '<hr />'; |
51 | 51 |
@@ -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 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | // Add some data |
33 | 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 | |
37 | 37 | for ($row = 1; $row <= $testDateCount; ++$row) { |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | $worksheet->getStyle('C1:C' . $testDateCount) |
44 | - ->getNumberFormat() |
|
45 | - ->setFormatCode('hh:mm:ss'); |
|
44 | + ->getNumberFormat() |
|
45 | + ->setFormatCode('hh:mm:ss'); |
|
46 | 46 | |
47 | 47 | echo '<hr />'; |
48 | 48 |
@@ -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 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | [2011, 2, 29], [7, 5, 3], [2012, 13, 1], [2012, 11, 45], |
36 | 36 | [2012, 0, 0], [2012, 1, 0], [2012, 0, 1], |
37 | 37 | [2012, -2, 2], [2012, 2, -2], [2012, -2, -2], |
38 | - ]; |
|
38 | + ]; |
|
39 | 39 | $testDateCount = count($testDates); |
40 | 40 | |
41 | 41 | $worksheet->fromArray($testDates, null, 'A1', true); |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | $worksheet->setCellValue('E' . $row, '=D' . $row); |
46 | 46 | } |
47 | 47 | $worksheet->getStyle('E1:E' . $testDateCount) |
48 | - ->getNumberFormat() |
|
49 | - ->setFormatCode('yyyy-mmm-dd'); |
|
48 | + ->getNumberFormat() |
|
49 | + ->setFormatCode('yyyy-mmm-dd'); |
|
50 | 50 | |
51 | 51 | echo '<hr />'; |
52 | 52 |
@@ -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); |