I have a somewhat irregularly structured CSV file I'm reading with fopen() and fgetcsv(). The first 5 lines are to be discarded.
Is there an efficient way to discard those 5 lines? What I have now is:
$fp = fopen($path,'r');
fgets($fp);fgets($fp);fgets($fp);fgets($fp);fgets($fp);
which gets the job done, but seems dirty.
seekwith line numbers. Without it you have to know the byte values$File->seek(PHP_INT_MAX); $end = $File->key(); $File->rewind()that can give you the line total much faster then iterating through it.... :0}