承接 ecommit/csv-table-generator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ecommit/csv-table-generator

最新稳定版本:v1.3.0

Composer 安装命令:

composer require ecommit/csv-table-generator

包简介

Create a CSV file with PHP array.

README 文档

README

Create a CSV file with PHP array.

Tests

Installation

To install csv-table-generator with Composer just run :

$ composer require ecommit/csv-table-generator

Usage

use Ecommit\CsvTableGenerator\Csv;

$csv = new Csv('/home/test', 'myfilename', array(
    'header' => array(
        'Column A',
        'Column B',
    ),
));

$csv->write(array('Hello', 'world')); //Add line
$csv->write(array('Test1', 'Test2')); //Add line
$csv->close();

/home/test/myfilename.csv is generated :

"Column A","Column B"
Hello,world
Test1,Test2

Constructor arguments :

  • String $pathDir : Path folder (when CSV file is generated) Required
  • String $filename : Filename (without path folder and extension) Required
  • Array $options : Options. See below

Availabled options :

  • header (array) : Header array. If empty, no header. Default: array()
  • max_lines (null | int) : Max lines per CSV file. If lines > max_lines, many files are generated. Default: null
  • delimiter (string) : CSV delimiter. Default: ,
  • enclosure (string) : CSV enclosure. Default: "
  • eol (string - Csv::EOL_ constants) : EOF(End Of Line) character. See Csv::EOL_ constants. Default: Csv::EOL_LF
  • escape : CSV escape. Default: \
  • add_utf8_bom (bool) : Add or not UTF8 bom. Default: false

License

This librairy is under the MIT license. See the complete license in LICENSE file.

统计信息

  • 总下载量: 10.7k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-08-27