From a09bb9b734f9fbd9b316916172207ff2dd37f570 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Mon, 25 Jan 2016 19:07:05 +0000 Subject: [PATCH] Worksheet information example --- Examples/44worksheetInfo.php | 58 ++++++++++++++++++++++++++++++++++++ Examples/runall.php | 1 + 2 files changed, 59 insertions(+) create mode 100644 Examples/44worksheetInfo.php diff --git a/Examples/44worksheetInfo.php b/Examples/44worksheetInfo.php new file mode 100644 index 00000000..5aeefcbd --- /dev/null +++ b/Examples/44worksheetInfo.php @@ -0,0 +1,58 @@ +'); + +date_default_timezone_set('Europe/London'); + +/** Include PHPExcel_IOFactory */ +require_once dirname(__FILE__) . '/../Classes/PHPExcel/IOFactory.php'; + + +if (!file_exists("05featuredemo.xlsx")) { + exit("Please run 05featuredemo.php first." . EOL); +} + +$inputFileName = "05featuredemo.xlsx"; +$inputFileType = PHPExcel_IOFactory::identify($inputFileName); +$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$sheetList = $objReader->listWorksheetNames($inputFileName); +$sheetInfo = $objReader->listWorksheetInfo($inputFileName); + +echo 'File Type:', PHP_EOL; +var_dump($inputFileType); + +echo 'Worksheet Names:', PHP_EOL; +var_dump($sheetList); + +echo 'Worksheet Names:', PHP_EOL; +var_dump($sheetInfo); + diff --git a/Examples/runall.php b/Examples/runall.php index cad5b39a..153cb765 100644 --- a/Examples/runall.php +++ b/Examples/runall.php @@ -103,6 +103,7 @@ $aTests = array( , '41password.php' , '42richText.php' , '43mergeWorkbooks.php' + , '44worksheetInfo.php' , 'OOCalcReader.php' , 'OOCalcReaderPCLZip.php' , 'SylkReader.php'