Similar to fgets() except that fgetcsv() parses the line it reads for fields in CSV format and returns an array containing the fields read. The field delimiter is a comma, unless you specify another delimiter with the optional third parameter. The enclosure character is double quote, unless it is specified. Delimiter and enclosure cannot be null and only first character is used when they are specified.
Length must be greater than the longest line to be found in the CSV file (allowing for trailing line-end characters).
fgetcsv() returns FALSE on error, including end of file.
Megjegyzés: A blank line in a CSV file will be returned as an array comprising a single NULL field, and will not be treated as an error.
enclosure is added from PHP 4.3.0.
Példa 1. fgetcsv() example - Read and print entire contents of a CSV file