@@ -32,16 +32,16 @@ |
||
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 | |
38 | 38 | /* Read the list of Worksheet Names from the Workbook file **/ |
39 | 39 | echo 'Read the list of Worksheets in the WorkBook<br />'; |
40 | 40 | $worksheetNames = $objReader->listWorksheetNames($inputFileName); |
41 | 41 | |
42 | -echo 'There are ',count($worksheetNames),' worksheet',((count($worksheetNames) == 1) ? '' : 's'),' in the workbook<br /><br />'; |
|
42 | +echo 'There are ', count($worksheetNames), ' worksheet', ((count($worksheetNames) == 1) ? '' : 's'), ' in the workbook<br /><br />'; |
|
43 | 43 | foreach ($worksheetNames as $worksheetName) { |
44 | - echo $worksheetName,'<br />'; |
|
44 | + echo $worksheetName, '<br />'; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | ?> |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | |
31 | 31 | $objReader = PHPExcel_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 | $objPHPExcel = $objReader->load($inputFileName); |
35 | 35 | $objPHPExcel->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 | $objReader->setSheetIndex($sheet + 1); |
39 | 39 | $objReader->loadIntoExisting($inputFileName, $objPHPExcel); |
40 | 40 | $objPHPExcel->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | |
43 | 43 | echo '<hr />'; |
44 | 44 | |
45 | -echo $objPHPExcel->getSheetCount(),' worksheet',(($objPHPExcel->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />'; |
|
45 | +echo $objPHPExcel->getSheetCount(), ' worksheet', (($objPHPExcel->getSheetCount() == 1) ? '' : 's'), ' loaded<br /><br />'; |
|
46 | 46 | $loadedSheetNames = $objPHPExcel->getSheetNames(); |
47 | 47 | foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { |
48 | - echo '<b>Worksheet #',$sheetIndex,' -> ',$loadedSheetName,'</b><br />'; |
|
48 | + echo '<b>Worksheet #', $sheetIndex, ' -> ', $loadedSheetName, '</b><br />'; |
|
49 | 49 | $objPHPExcel->setActiveSheetIndexByName($loadedSheetName); |
50 | 50 | $sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true); |
51 | 51 | var_dump($sheetData); |
@@ -33,18 +33,18 @@ |
||
33 | 33 | $inputFileName = './sampleData/example1.xls'; |
34 | 34 | $sheetname = 'Data Sheet #2'; |
35 | 35 | |
36 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
36 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
37 | 37 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); |
38 | -echo 'Loading Sheet "',$sheetname,'" only<br />'; |
|
38 | +echo 'Loading Sheet "', $sheetname, '" only<br />'; |
|
39 | 39 | $objReader->setLoadSheetsOnly($sheetname); |
40 | 40 | $objPHPExcel = $objReader->load($inputFileName); |
41 | 41 | |
42 | 42 | echo '<hr />'; |
43 | 43 | |
44 | -echo $objPHPExcel->getSheetCount(),' worksheet',(($objPHPExcel->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />'; |
|
44 | +echo $objPHPExcel->getSheetCount(), ' worksheet', (($objPHPExcel->getSheetCount() == 1) ? '' : 's'), ' loaded<br /><br />'; |
|
45 | 45 | $loadedSheetNames = $objPHPExcel->getSheetNames(); |
46 | 46 | foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { |
47 | - echo $sheetIndex,' -> ',$loadedSheetName,'<br />'; |
|
47 | + echo $sheetIndex, ' -> ', $loadedSheetName, '<br />'; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | ?> |
@@ -62,7 +62,7 @@ |
||
62 | 62 | /* Tell the Reader that we want to use the Read Filter that we've Instantiated **/ |
63 | 63 | /* and that we want to store it in contiguous rows/columns **/ |
64 | 64 | $objReader->setReadFilter($chunkFilter) |
65 | - ->setContiguous(true); |
|
65 | + ->setContiguous(true); |
|
66 | 66 | |
67 | 67 | /* Instantiate a new PHPExcel object manually **/ |
68 | 68 | $objPHPExcel = new PHPExcel(); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
51 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
51 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
52 | 52 | /* Create a new Reader of the type defined in $inputFileType **/ |
53 | 53 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); |
54 | 54 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | /* Loop to read our worksheet in "chunk size" blocks **/ |
73 | 73 | /** $startRow is set to 2 initially because we always read the headings in row #1 **/ |
74 | 74 | for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) { |
75 | - echo 'Loading WorkSheet #',($sheet + 1),' using configurable filter for headings row 1 and for rows ',$startRow,' to ',($startRow + $chunkSize - 1),'<br />'; |
|
75 | + echo 'Loading WorkSheet #', ($sheet + 1), ' using configurable filter for headings row 1 and for rows ', $startRow, ' to ', ($startRow + $chunkSize - 1), '<br />'; |
|
76 | 76 | /* Tell the Read Filter, the limits on which rows we want to read this iteration **/ |
77 | 77 | $chunkFilter->setRows($startRow, $chunkSize); |
78 | 78 | |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | |
88 | 88 | echo '<hr />'; |
89 | 89 | |
90 | -echo $objPHPExcel->getSheetCount(),' worksheet',(($objPHPExcel->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />'; |
|
90 | +echo $objPHPExcel->getSheetCount(), ' worksheet', (($objPHPExcel->getSheetCount() == 1) ? '' : 's'), ' loaded<br /><br />'; |
|
91 | 91 | $loadedSheetNames = $objPHPExcel->getSheetNames(); |
92 | 92 | foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { |
93 | - echo '<b>Worksheet #',$sheetIndex,' -> ',$loadedSheetName,'</b><br />'; |
|
93 | + echo '<b>Worksheet #', $sheetIndex, ' -> ', $loadedSheetName, '</b><br />'; |
|
94 | 94 | $objPHPExcel->setActiveSheetIndexByName($loadedSheetName); |
95 | 95 | $sheetData = $objPHPExcel->getActiveSheet()->toArray(null, false, false, true); |
96 | 96 | var_dump($sheetData); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
60 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
61 | 61 | /* Create a new Reader of the type defined in $inputFileType **/ |
62 | 62 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); |
63 | 63 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | /* Loop to read our worksheet in "chunk size" blocks **/ |
75 | 75 | for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) { |
76 | - echo 'Loading WorkSheet using configurable filter for headings row 1 and for rows ',$startRow,' to ',($startRow + $chunkSize - 1),'<br />'; |
|
76 | + echo 'Loading WorkSheet using configurable filter for headings row 1 and for rows ', $startRow, ' to ', ($startRow + $chunkSize - 1), '<br />'; |
|
77 | 77 | /* Tell the Read Filter, the limits on which rows we want to read this iteration **/ |
78 | 78 | $chunkFilter->setRows($startRow, $chunkSize); |
79 | 79 | /* Load only the rows that match our filter from $inputFileName to a PHPExcel Object **/ |
@@ -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); |
@@ -28,9 +28,9 @@ |
||
28 | 28 | $inputFileName = './sampleData/example1.xls'; |
29 | 29 | |
30 | 30 | $inputFileType = PHPExcel_IOFactory::identify($inputFileName); |
31 | -echo 'File ',pathinfo($inputFileName, PATHINFO_BASENAME),' has been identified as an ',$inputFileType,' file<br />'; |
|
31 | +echo 'File ', pathinfo($inputFileName, PATHINFO_BASENAME), ' has been identified as an ', $inputFileType, ' file<br />'; |
|
32 | 32 | |
33 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with the identified reader type<br />'; |
|
33 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with the identified reader type<br />'; |
|
34 | 34 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); |
35 | 35 | $objPHPExcel = $objReader->load($inputFileName); |
36 | 36 |
@@ -33,18 +33,18 @@ |
||
33 | 33 | $inputFileName = './sampleData/example1.xls'; |
34 | 34 | $sheetnames = ['Data Sheet #1', 'Data Sheet #3']; |
35 | 35 | |
36 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
36 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
37 | 37 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); |
38 | -echo 'Loading Sheet',((count($sheetnames) == 1) ? '' : 's'),' "',implode('" and "', $sheetnames),'" only<br />'; |
|
38 | +echo 'Loading Sheet', ((count($sheetnames) == 1) ? '' : 's'), ' "', implode('" and "', $sheetnames), '" only<br />'; |
|
39 | 39 | $objReader->setLoadSheetsOnly($sheetnames); |
40 | 40 | $objPHPExcel = $objReader->load($inputFileName); |
41 | 41 | |
42 | 42 | echo '<hr />'; |
43 | 43 | |
44 | -echo $objPHPExcel->getSheetCount(),' worksheet',(($objPHPExcel->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />'; |
|
44 | +echo $objPHPExcel->getSheetCount(), ' worksheet', (($objPHPExcel->getSheetCount() == 1) ? '' : 's'), ' loaded<br /><br />'; |
|
45 | 45 | $loadedSheetNames = $objPHPExcel->getSheetNames(); |
46 | 46 | foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { |
47 | - echo $sheetIndex,' -> ',$loadedSheetName,'<br />'; |
|
47 | + echo $sheetIndex, ' -> ', $loadedSheetName, '<br />'; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | ?> |
@@ -34,10 +34,10 @@ |
||
34 | 34 | $h1Text = $out[1]; |
35 | 35 | $h2Text = (preg_match($h2Pattern, $fileData, $out)) ? $out[1] : ''; |
36 | 36 | |
37 | - echo '<a href="',$exampleFile,'">',$h1Text,'</a><br />'; |
|
37 | + echo '<a href="', $exampleFile, '">', $h1Text, '</a><br />'; |
|
38 | 38 | if (($h2Text > '') && |
39 | 39 | (pathinfo($exampleType, PATHINFO_BASENAME) != 'Calculations')) { |
40 | - echo $h2Text,'<br />'; |
|
40 | + echo $h2Text, '<br />'; |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | } |