承接 chinahub/xls-writer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

chinahub/xls-writer

Composer 安装命令:

composer require chinahub/xls-writer

包简介

php xls library based on xlsWriter

README 文档

README

php xls library based on xlsWriter, php-xlsWriter:https://github.com/viest/php-ext-xlswriter

Installation

Run the following command to install the latest applicable version of the package:

composer require chinahub/xls-writer

Env Required

  • xlswriter extention
pecl install xlswriter
# add extension = xlswriter.so to php.ini
  • recommend PHP > 7.4

Usage

Export

use Chinahub\XlsWriter\interfaces\ExportInterface;

class UserExport implements ExportInterface
{
    public function headers(): array
    {
        return ['id','name','email'];
    }

    public function data(): array
    {
        return [
            [1,'tom','test@qq.com'],
            [2,'lily','test@gmail.com'],
            [3,'lisa','test@163.com'],

        ];
    }
}

output path

use Chinahub\XlsWriter\Export;

$excel = new Export(new UserExport());
$excel->config = ['path' => '/www'];
$excel->fileName = 'user.xlsx';
$excel->output();

output download

use Chinahub\XlsWriter\Export;

$excel = new Export(new UserExport());
$excel->fileName = 'user.xlsx';
$excel->download();

Import

get all data from sheet

use Chinahub\XlsWriter\Import;

$excel = new Import('/www/user.xlsx');
$excel->getSheet();

get row from sheet

use Chinahub\XlsWriter\Import;

$excel = new Import('/www/user.xlsx');
$excel = $excel->instance();
while (($row = $excel->nextRow()) !== NULL) {
    var_dump($row);
}

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-04-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固