No Description

exampleReader01.php 860B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. error_reporting(E_ALL);
  3. set_time_limit(0);
  4. date_default_timezone_set('Europe/London');
  5. ?>
  6. <html>
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  9. <title>PHPExcel Reader Example #01</title>
  10. </head>
  11. <body>
  12. <h1>PHPExcel Reader Example #01</h1>
  13. <h2>Simple File Reader using PHPExcel_IOFactory::load()</h2>
  14. <?php
  15. /** Include path **/
  16. set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
  17. /** PHPExcel_IOFactory */
  18. include 'PHPExcel/IOFactory.php';
  19. $inputFileName = './sampleData/example1.xls';
  20. echo 'Loading file ',pathinfo($inputFileName,PATHINFO_BASENAME),' using IOFactory to identify the format<br />';
  21. $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
  22. echo '<hr />';
  23. $sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
  24. var_dump($sheetData);
  25. ?>
  26. <body>
  27. </html>