一、安装
包地址
https://packagist.org/packages/box/spout
github地址
https://github.com/box/spout
安装包
composer require maatwebsite/excel
二、实例
下面是3.3版本使用demo
<?php
namespace App\Lib;
use Box\Spout\Reader\Common\Creator\ReaderEntityFactory;
use Box\Spout\Writer\Common\Creator\WriterEntityFactory;
class ExcelSpout{
private $head = [];
private $data = [];
private $name = '';
public function __construct($head=[],$data=[],$name=''){
$this->head = $head;//csv 表头 ['id','name']
$this