php上传Excel文件时如何判断文件中是否有图片的方法
时间:2021-07-01 10:21:17
帮助过:9人阅读
- $excelPath = 'Test.xls';
-
- $objReader = PHPExcel_IOFactory::createReader('Excel5');
- $objReader->setReadDataOnly(true);
-
- $objPHPExcel = $objReader->load($excelPath);
- $currentSheet = $objPHPExcel->getActiveSheet();
- $AllImages= $currentSheet->getDrawingCollection();
-
- if(count($AllImages) > 0) {
- //处理
- }
- ?>
|