dcblogdev/exportcsv
Composer 安装命令:
composer require dcblogdev/exportcsv
包简介
Export array to CSV
README 文档
README
Export arrays to CSV
Install Using composer include the repository by typing the following into a terminal
composer require dcblogdev/exportcsv
Usage
Include the composer autoloader, import the ExportCsv namespace.
use Dcblogdev\ExportCsv\ExportCsv; //set filename $filename = 'test.csv'; //set column names $headerFields = ['First Name', 'Last Name', 'Company', 'Created']; //create array $records = []; //loop through data and add to array foreach($contacts as $row) { $records[] = [ $row->firstName, $row->lastName, $row->companyName, $row->created_at ]; } //OR set an array manually $records[] = ['name', 'last name', 'comy', 'created']; //send params to csv new ExportCsv($records, $filename, $headerFields);
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-12-28