How do I determine the end of the file using PHPExcel library in chunk loop?

后端 未结 2 1998
野的像风
野的像风 2021-01-21 18:40

Using the PHPExcel library, I am attempting to iterate over around 1500 rows, each row has about 25 columns.

I am using this code (taken from PHPExcel runs out of 256, 5

2条回答
  •  萌比男神i
    2021-01-21 19:27

    I would normally do this:

    $objPHPExcel = $objReader->load($inputFileName);    
    $rows = count($objPHPExcel->getActiveSheet()->toArray());    
    for ($start_row = 1; $start_row < $rows; $start_row ++)
    // ...
    

    $excel->getActiveSheet()->toArray() will only return each row (with data) in an array.

提交回复
热议问题