复制代码 代码如下://模板存放目录$dir = $DOCUMENT_ROOT.’/backoffice/admin/oemcheck/’;$templateName = ‘1.xlsx’;$outputFileName = ‘模板.xlsx’;$txt=’test’;//实例化Excel读取类$PHPReader = new PHPExcel_Reader_Excel2007();if(!$PHPReader->canRead($dir.$templateName)){ $PHPReader = new PHPExcel_Reader_Excel5(); if(!$PHPReader->ca