php判断上传的Excel文件中是否有图片及PHPExcel库认识
时间:2020-10-03 10:15:52|栏目:PHP代码|点击: 次
需要借助PHPExcel这个库
$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) {
//处理
}
复制代码 代码如下:
$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) {
//处理
}
上一篇:php微信公众号开发之现金红包
栏 目:PHP代码
本文标题:php判断上传的Excel文件中是否有图片及PHPExcel库认识
本文地址:http://www.codeinn.net/misctech/6447.html