silverkron/php-csv-builder
最新稳定版本:v1.0.1
Composer 安装命令:
composer require silverkron/php-csv-builder
包简介
Build csv file and save or download it
README 文档
README
Build csv file and save or download it. Simple librery to write csv file in your php application
Install
Install php-csv-builder with Composer.
$ composer require silverkron/php-csv-builder
Initialize the class
use CsvBuilder\CsvBuilder; $csvBuilder = new CsvBuilder();
Available methods
Change default destination path
setFilePath(<string>)
$csvBuilder->setFilePath('/path/to/file');
Change default file name
setFileName(<string>)
$csvBuilder->setFileName('/path/to/file');
Set row of titles (required)
setTitles(<array>)
$csvBuilder->setTitles([ 'Title 1', 'Title 2', 'Title 3', 'Title 4' ]);
Clear all rows
clearRows(<array>)
$csvBuilder->clearRows();
Add new row (required)
addRow(<array>)
$csvBuilder->addRow([ 'Column 1', 'Column 2', 'Column 3', 'Column 4', ]);
Build the csv file (required for download)
create()
$csvBuilder->create();
Download csv file
download()
$csvBuilder->download();
License
The MIT License (MIT). Please see LICENSE for more information.
统计信息
- 总下载量: 53
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-23