PHP's own function fputcsv can be used to print the report (Excel) function. If your report format requirements are not very high, then fputcsv is a good choice. It performs efficiently and does not require a third-party library, which is convenient
This article mainly introduces how to read and write data using the fputcsv () function csv file in php, and analyzes the skills of the fputcsv () function for reading and writing csv files, which has some reference value, for more information,
PHP uses the Fputcsv () function CSV file to read and write data,
This example describes how PHP uses the Fputcsv () function CSV file to read and write data. Share to everyone for your reference. The specific analysis is as follows:
The Fputcsv ()
PHP tutorial Fputcsv () function CSV data read/write database tutorial file code
The Fputcsv () function is used to format the data in CSV format for writing to a file or database.
1. Writing a string to the CSV file
$test _array = Array
This article mainly introduces how to read and write data using the fputcsv () function csv file in php, and analyzes the skills of the fputcsv () function for reading and writing csv files, which has some reference value, for more information about
Command: Fputcsv ()
Command format: int fputcsv (resource handle [, array fields [, String delimiter [, String enclosure]])
Command parsing: fputcsv () formats a row (passed in the fields array) in CSV format and writes the file specified by handle.
Fputcsv How to force all data to be enclosed in double quotes
Fputcsv How to force all data to be enclosed in double quotes
------Solution--------------------
That's what the document says,
PHP Code
fputcsv-format the row as CSV and write the
Command: Fputcsv ()
Command format: int fputcsv (resource handle [, array fields [, String delimiter [, String enclosure]])
Command parsing: fputcsv () formats a row (passed in the fields array) in CSV format and writes the file specified by handle.
Old topic... for help exporting EXCEL via PHP, the phpexcel class is very powerful, but the efficiency is low and the speed of fputcsv is fast, but I don't know how to solve the problem of scientific notation, ask the old driver to teach his
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.