Home > php教程 > php手册 > body text

php 导出csv(excel)文件

WBOY
Release: 2016-06-07 11:44:43
Original
1140 people have browsed it

方便,快捷导出csv(excel)文件
php 导出csv(excel)文件 是个很常用的功能,现将代码分享出来,供大家使用。

简单使用如下:<?php <br /> <br> // load library<br> require 'php-excel.class.php';<br> <br> // create a simple 2-dimensional array<br> $data = array(<br>         1 => array ('Name', 'Surname'),<br>         array('Schwarz', 'Oliver'),<br>         array('Test', 'Peter')<br>         );<br> <br> // generate file (constructor parameters are optional)<br> $xls = new Excel_XML('UTF-8', false, 'My Test Sheet');<br> $xls->addArray($data);<br> $xls->generateXML('my-test');<br> <br> ?>'php-excel.class.php 存放在附件中。

附件 php-excel.class.rar ( 2.03 KB 下载:490 次 )

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template