How can I get the total number of rows that are in a CSV file using PHP? I\'m using this method but can get it to work properly.
if (($fp = fopen(\"test.csv\
In case you are getting the file from a form
$file = $_FILES['csv']['tmp_name']; $fp = new SplFileObject($file, 'r'); $fp->seek(PHP_INT_MAX); echo $fp->key() + 1; $fp->rewind();
Works like charm!!!!!!!!!!!!!!!!!!