Is there a function to count the amount of lines in a CSV files without manually looping through the whole file and counting them?? I have looked on php.net and couldn't seem to find anything.
You could read the file using the file() command.
That puts it into an array where each element is one line (with the line break still attached).
The do a count($myArray) to get the number of lines.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.