How can fputcsv force all data to be enclosed by double quotation marks?

Source: Internet
Author: User
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 ().

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.