http://php.net/fgetcsv There's a builtin PHP function

does anyone know how to get the max lenght of any line in the file? the fgetcsv() requires a lenght argument that should ne greater that the longest line in the file.

does anyone know how to get the max lenght of any line in the file? the fgetcsv() requires a lenght argument that should ne greater that the longest line in the file.

Unless you're using PHP4 you don't need it, if the PHP document shows an argument in [] then it is optional

fgetcsv() parses the line it reads for fields in CSV format and returns an array containing the fields read.
. . . . .
length
Must be greater than the longest line (in characters) to be found in the CSV file (allowing for trailing line-end characters). It became optional in PHP 5. Omitting this parameter (or setting it to 0 in PHP 5.0.4 and later) the maximum line length is not limited, which is slightly slower.
. . . . .

no longer really necessary, if your host is running php5

its not a very well formed file, only 3 lines, a list of brandnames, semi-colon separated no quotes

Edited 3 Years Ago by mike_2000_17: Fixed formatting

This article has been dead for over six months. Start a new discussion instead.