Read only specific sheet

前端 未结 4 1401
面向向阳花
面向向阳花 2021-01-01 17:26

I am trying to read just one sheet from an xls document and I have this:

 $objPHPExcel = $objReader->load(\'daily/\' . $fisierInbound);
 $objWorksheet = $         


        
4条回答
  •  無奈伤痛
    2021-01-01 17:56

    An easiest way for those who is still struggling with this -

    //include library
    include('path/to/PHPExcel/IOFactory.php');
    
    //load the file
    $objPHPExcel = PHPExcel_IOFactory::load('your/path/for/excel/file');
    
    //get the worksheet of your choice by its name
    $worksheet = $objPHPExcel->getSheetByName('Name of sheet');
    
    #and your work goes here...
    

提交回复
热议问题