作者原话
PhpSpreadsheet is a library written in pure PHP and offers a set of classes that allow you to read and write various spreadsheet file formats such as Excel and LibreOffice Calc.
翻译过来
PhpSpreadsheet是一个纯PHP编写的库,提供了一组类,允许您读取和编写各种电子表格文件格式,如Excel和LibreOffice Calc。
我用的是thinkphp5.1的框架,需要安装一个处理Excel表格,但是当我使用composer命令安装的时候居然发现安装失败。
仔细一看,原来是没有开启扩展,当我去查看php.ini的配置文件的时候发现,什么???居然没有这个扩展。于是我便把php7.4的扩展复制到了php7.2的目录下,然后再打开php.ini,修改一下。
最终再执行一下安装命令,O了个K。大功告成,可以使用phpspreadsheet了。
注意1.18版本只能是php7.2以上版本支持
phpspreadsheet官方网站
如果你想在更低版本的php使用,请移步composer官方网站