PHP code example of xihongke / csv-exporter
1. Go to this page and download the library: Download xihongke/csv-exporter library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
xihongke / csv-exporter example snippets
use XihongKe\CsvExporter\CsvExporter;
$exporter = new CsvExporter("学生列表", ['学号', '姓名', '性别']);
// 往表里写入单行数据
$exporter->row(['1001', '张三', '男']);
// 多行数据
$exporter->rows([
['1002', '李红', '女'],
['1003', '吴均', '男'],
]);