开发者

format .csv data created with fputcsv into Excel-like tables

开发者 https://www.devze.com 2023-04-13 08:40 出处:网络
is there a way that I can format data from a .csv file created with the php function fputcsv into Excel-like tabl开发者_开发百科es? Meaning, I don\'t want my data to be separated by commas, I want the

is there a way that I can format data from a .csv file created with the php function fputcsv into Excel-like tabl开发者_开发百科es? Meaning, I don't want my data to be separated by commas, I want them to appear in tables like an Excel spreadsheet or something.

I know I can do that in Excel itself, but is there a way to do that directly without tweaking the file in Excel (like with a php function or something)


fputcsv does exactly what the manual says: It formats a line as CSV and writes it to a file pointer.

The output can then be imported into Excel or other csv-capable software.

You can generate Excel files directly via php, too, but therefore you have to delve very deep into the Excel file format. If you want to do this, I recommend PHPExcel. This project provides...

...a set of classes for the PHP programming language, which allow you to write to and read from different file formats, like Excel 2007, PDF, HTML, ... This project is built around Microsoft's OpenXML standard and PHP.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号