Menu Samaritan's Purse

FPUTCSV

Format line as CSV and write to file pointer

SYNTAX

fputcsv ( resource $handle , array $fields [, string $delimiter = "," [, string $enclosure = '"' [, string $escape_char = "\\" ]]] ) : int

PARAMETERS

handle

The file pointer must be valid, and must point to a file successfully opened by fopen() or fsockopen() (and not yet closed by fclose()).

fields

An array of strings.

delimiter

The optional delimiter parameter sets the field delimiter (one character only).

enclosure

The optional enclosure parameter sets the field enclosure (one character only).

escape_char

The optional escape_char parameter sets the escape character (at most one character). An empty string ("") disables the proprietary escape mechanism.

RETURN

Returns the length of the written string or FALSE on failure.

EXAMPLES

aaa,bbb,ccc,dddd
123,456,789
""aaa""","""bbb"""

PHP