PHP code example of gf2007 / excel
1. Go to this page and download the library: Download gf2007/excel 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/ */
gf2007 / excel example snippets
use gerfin\excel\Exporter;
$exporter = new Exporter();
/**
* @param array $data 源数据 ram string $format 格式xls或xlsx optional
* @param string $sheetName sheet名称 optional
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
$exporter->export([["1","jack"],["2", "nancy"]], ["id", "name"], "excelName", "xls", "sheetName");