php determines whether the uploaded Excel file contains pictures and PHPExcel library knowledge
- 2020-05-27 04:29:28
- OfStack
You need the library 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) {
// To deal with
}