nuovo / spreadsheet-reader

A PHP spreadsheet reader (Excel XLS and XLSX, OpenOffice ODS, and variously separated text files) with a singular goal of getting the data out, efficiently
http://www.nuovo.lv/
Other
674 stars 497 forks source link

getting the row counts #164

Open JAKEVICENTE opened 4 years ago

JAKEVICENTE commented 4 years ago

Hi Guys!

First thing 1st is that I'm a NEW pleb learning PHP

Currently, to get the row counts from my imported excel file. I used this code below:

 $rows = 0;
 foreach ($Reader as $key=>$Row) 
    {
        if ($key!=0) // HEADER NOT INCLUDED
        {
            $rows++;
        }
    }

Is there a better way for this? I tried using rowCount but an error keeps occuring...

Thank you very much!