The fputcsv() function formats rows to CSV and writes them to an open file.
This function returns the length of the written string. If it fails, returns FALSE.
fputcsv(file,fields,seperator,enclosure)
parameter | describe |
---|---|
file | Required. Specifies the open file to write to. |
fields | Required. Specifies the array from which data is to be obtained. |
separator | Optional. Set field delimiter (only one character allowed), default value is comma (,). |
enclosure | Optional. Set field wrap character (only one character allowed), default is double quotes ( " ). |
Tip: See the fgetcsv() function.