fgetcsv

array fgetcsv(resource file_handle, int length, [string delimiter]) 
file_handle File handle
length Number of characters to read
delimiter Value separator

Reads data from a CSV (comma-separated value) file.

Returns:

Array; FALSE on error or EOF

Description:

Parses a line from a CSV (comma-separated value) file and returns it in an array. The length parameter must be longer than the longest line present in the source file, including any line-end characters. Each value extracted from the input line is returned as one element in the return array. Empty lines return an empty array.

The function handles quoted values sensibly—ignoring commas within the quote.

When the function reaches the end of the file or encounters an error, FALSE ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.