How does fputcsv force all data to be enclosed by double quotation marks, PHPcodefputcsv-format the row as CSV and write the file pointer to explain how resource $ ha fputcsv forces double quotation marks on all data
How does fputcsv force all data to be enclosed by double quotation marks?
------ Solution --------------------
This is what the document says,
PHP code
Fputcsv-format the row as CSV and write the file pointer description int fputcsv (resource $ handle [, array $ fields [, string $ delimiter [, string $ enclosure]) fputcsv () format a row (transmitted using the fields array) into CSV format and write the file specified by handle. Returns the length of the written string. If an error occurs, FALSE is returned. The optional delimiter parameter sets the field delimiter (only one character is allowed ). The default value is comma :,. The optional enclosure parameter sets the field surround character (only one character is allowed ). Double quotation marks by default :". Example #1 fputcsv () Example
Note: If PHP does not correctly recognize the row Terminator when reading files created on or on a Macintosh computer, enabling the runtime configuration option auto_detect_line_endings may solve this problem. See fgetcsv ().