PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.1.1
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.1.1
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
visualizer / vendor / phpoffice / phpexcel / Documentation / Examples / Reader / exampleReader07.php

exampleReader07.php in Visualizer – Tables & Charts Manager with Built-in AI Generator 3.1.1, at vendor/phpoffice/phpexcel/Documentation/Examples/Reader/exampleReader07.php

55 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 error_reporting(E_ALL);
4 set_time_limit(0);
5
6 date_default_timezone_set('Europe/London');
7
8 ?>
9 <html>
10 <head>
11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
12
13 <title>PHPExcel Reader Example #07</title>
14
15 </head>
16 <body>
17
18 <h1>PHPExcel Reader Example #07</h1>
19 <h2>Simple File Reader Loading a Single Named WorkSheet</h2>
20 <?php
21
22 /** Include path **/
23 set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
24
25 /** PHPExcel_IOFactory */
26 include 'PHPExcel/IOFactory.php';
27
28
29 $inputFileType = 'Excel5';
30 // $inputFileType = 'Excel2007';
31 // $inputFileType = 'Excel2003XML';
32 // $inputFileType = 'OOCalc';
33 // $inputFileType = 'Gnumeric';
34 $inputFileName = './sampleData/example1.xls';
35 $sheetname = 'Data Sheet #2';
36
37 echo 'Loading file ',pathinfo($inputFileName,PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />';
38 $objReader = PHPExcel_IOFactory::createReader($inputFileType);
39 echo 'Loading Sheet "',$sheetname,'" only<br />';
40 $objReader->setLoadSheetsOnly($sheetname);
41 $objPHPExcel = $objReader->load($inputFileName);
42
43
44 echo '<hr />';
45
46 echo $objPHPExcel->getSheetCount(),' worksheet',(($objPHPExcel->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />';
47 $loadedSheetNames = $objPHPExcel->getSheetNames();
48 foreach($loadedSheetNames as $sheetIndex => $loadedSheetName) {
49 echo $sheetIndex,' -> ',$loadedSheetName,'<br />';
50 }
51
52
53 ?>
54 <body>
55 </html>