From 45109e05338c87a73a65c8be806a15a604aa2125 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Tue, 19 Oct 2010 12:40:52 +0000 Subject: [PATCH] Reader exception handling example git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@62434 2327b42d-5241-43d6-9e2a-de5ac946f064 --- .../Examples/Reader/exampleReader13.php | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Documentation/Examples/Reader/exampleReader13.php diff --git a/Documentation/Examples/Reader/exampleReader13.php b/Documentation/Examples/Reader/exampleReader13.php new file mode 100644 index 00000000..1b0bfa55 --- /dev/null +++ b/Documentation/Examples/Reader/exampleReader13.php @@ -0,0 +1,46 @@ + + + + + +PHPExcel Reader Example #13 + + + + +

PHPExcel Reader Example #13

+

Handling Loader Exceptions using Try/Catch

+'; +try { + $objPHPExcel = PHPExcel_IOFactory::load($inputFileName); +} catch(Exception $e) { + die('Error loading file "',pathinfo($inputFileName,PATHINFO_BASENAME),'": ',$e->getMessage()); +} + + +echo '
'; + +$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true); +var_dump($sheetData); + + +?> + + \ No newline at end of file