Home >Backend Development >PHP Tutorial >How to determine if there are pictures in the file when uploading an Excel file in PHP_PHP Tutorial

How to determine if there are pictures in the file when uploading an Excel file in PHP_PHP Tutorial

WBOY
WBOYOriginal
2016-07-20 11:11:27979browse

How to determine if there are pictures in the file when uploading an Excel file in PHP. Friends in need can refer to it.

 代码如下 复制代码
$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) {
    //处理
 }

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/444638.htmlTechArticleHow to judge whether there are pictures in the file when uploading an Excel file with php. Friends in need can refer to it. The code is as follows Copy the code $excelPath = 'Test.xls'; $objReader = PHPExcel_IOFactory::create...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn