diego3/php-export-data
Composer 安装命令:
composer require diego3/php-export-data
包简介
A simple library for exporting tabular data to Excel-friendly XML, CSV, or TSV
README 文档
README
php-export-data by Eli Dickinson
http://github.com/elidickinson/php-export-data
Released under the permissive MIT License: http://www.opensource.org/licenses/mit-license.php
A simple library for exporting tabular data to Excel-friendly XML, CSV, or TSV. It supports streaming exported data to a file or directly to the browser as a download so it is suitable for exporting large datasets (you won't run out of memory).
Excel XML code is based on Excel_XML by Oliver Schwarz (http://github.com/oliverschwarz/php-excel)
Composer Install
composer require diego3/php-export-data
How to use it
// When executed in a browser, this script will prompt for download // of 'test.xls' which can then be opened by Excel or OpenOffice. use Export\ExportDataExcel; // 'browser' tells the library to stream the data directly to the browser. // other options are 'file' or 'string' // 'test.xls' is the filename that the browser will use when attempting to // save the download $exporter = new ExportDataExcel('browser', 'test.xls'); $exporter->initialize(); // starts streaming data to web browser // pass addRow() an array and it converts it to Excel XML format and sends // it to the browser $exporter->addRow(array("This", "is", "a", "test")); $exporter->addRow(array(1, 2, 3, "123-456-7890")); // doesn't care how many columns you give it $exporter->addRow(array("foo")); $exporter->finalize(); // writes the footer, flushes remaining data to browser. exit(); // all done
See the test/ directory for more examples.
Some other options for creating Excel files from PHP are listed here: http://stackoverflow.com/questions/3930975/alternative-for-php-excel/3931142#3931142
diego3/php-export-data 适用场景与选型建议
diego3/php-export-data 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.11k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2015 年 10 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「excel」 「csv」 「library」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 diego3/php-export-data 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 diego3/php-export-data 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 diego3/php-export-data 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This Symfony bundle integrates PhpSpreadsheet into Symfony using Twig.
PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine
Yii2 export extension
PHP Excel Library
Inbox pattern process implementation for your Laravel Applications
laravel facade to read/write csv file
统计信息
- 总下载量: 6.11k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-13