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 optional third delimiter parameter defaults as a comma, and the optional enclosure defaults as a double quotation mark. Both delimiter and enclosure are limited to one character. If either is more than one character, only the first character is used.
Note: The enclosure parameter was added in PHP 4.3.0.
The length parameter 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.
Note: 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.
Example 1. Read and print the entire contents of a CSV file
|Sites of interest: Web Hosting : Reseller Hosting : Website Hosting : HTML Editor : Web Design Templates : Free Web Hosting : ASP code examples : PHP & MySQL Code Examples|