我想只计算在phpexel中不是空白的行

时间:2017-02-13 11:04:59

标签: php phpexcel

我使用phpexel读取exel(.xlsx)文件,但我想只计算那些非黑色的行。我的代码如下。

    $objReader = PHPExcel_IOFactory::createReader($inputFileType);
    $objPHPExcel = $objReader->load($inputFileName);
    $worksheetData = $objReader->listWorksheetInfo($inputFileName);
    foreach ($worksheetData as $worksheet) {
            if($worksheet['worksheetName']=="abc"){
                 $TotalRow_a = $worksheet['totalRows'];}
            if($worksheet['worksheetName']=="xyz"){
                $TotalRow_x = $worksheet['totalRows'];
            }
            if($worksheet['worksheetName']=="op"){
                $TotalRow_o = $worksheet['totalRows'];}
    }

0 个答案:

没有答案