PHPackages                             xudongyss/phpoffice - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. xudongyss/phpoffice

ActiveLibrary

xudongyss/phpoffice
===================

1.0.0(5y ago)06PHP

Since Dec 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/xudongyss/phpoffice)[ Packagist](https://packagist.org/packages/xudongyss/phpoffice)[ RSS](/packages/xudongyss-phpoffice/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

PHPOffice
=========

[](#phpoffice)

\[TOC\]

安装
--

[](#安装)

```
composer require xudongyss/phpoffice

```

快速使用
----

[](#快速使用)

### Excel

[](#excel)

#### 初始化

[](#初始化)

```
require_once 'vendor/autoload.php';

use XuDongYss\PhpOffice\Excel;

$excel = new Excel();
```

#### 导入

[](#导入)

```
$_data = $excel->import('001.xlsx');
//$_data 单元格数据，数组
```

```
Array
(
    [1] => Array
        (
            [A] => 订单号
            [B] => 店铺
            [C] => 订单状态
            [D] => 核销方式
            [E] => 订单创建时间
            [F] => 买家付款时间
            [G] => 付款方式
            [H] => 支付流水号
            [I] => 商品金额合计
            [J] => 优惠合计
            [K] => 应收订单金额
            [L] => 订单实付金额
            [M] => 全部商品
            [N] => 买家手机号
        )

    [2] => Array
        (
            [A] =>
            [B] =>
            [C] => 交易成功
            [D] => 自提
            [E] => 2020-12-18 11:03:31
            [F] => 2020-12-18 11:03:49
            [G] => 微信支付
            [H] =>
            [I] => 10
            [J] => 0
            [K] => 10
            [L] => 10
            [M] => 长寿花(数量：1)
            [N] =>
        )
)
```

#### 导出

[](#导出)

```
$filename = '导出测试';
$_data = [];
$column_field = [
    ['column'=> '用户ID', 'field'=> 'id', 'data_type'=> 's'],
    ['column'=> '手机号', 'field'=> 'mobile', 'data_type'=> 's'],
    ['column'=> '昵称', 'field'=> 'nickname'],
    ['column'=> '余额', 'field'=> 'avail_money'],
    ['column'=> '已提现金额', 'field'=> 'cash_money'],
    ['column'=> '总余额', 'field'=> 'all_money'],
    ['column'=> 'VIP', 'field'=> 'vip_title'],
    ['column'=> '银行卡号', 'field'=> 'bank_card', 'data_type'=> 's'],
    ['column'=> '开户银行', 'field'=> 'bank_name'],
    ['column'=> '持卡人姓名', 'field'=> 'bank_realname'],
    ['column'=> '注册时间', 'field'=> 'register_time'],
];
$excel->export($filename, $_data, $column_field);
```

```
//$_data
Array
(
    [0] => Array
        (
            [id] => 100000012
            [mobile] => 13500000021
            [nickname] => 13500****21
            [all_money] => 1600000.00
            [avail_money] => 1600000.00
            [cash_money] => 0.00
            [bank_name] => Ngân hàng Ngoại thương Việt Nam
            [bank_card] => 363636636636
            [bank_realname] => 啦啦啦肯
            [vip_title] => 普通会员
        )
)
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1974d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f89328b21f1a0ff093d7c8df84f784af3cdd9c81c016362a65eb98dac4634fe?d=identicon)[xudongyss](/maintainers/xudongyss)

---

Top Contributors

[![xudongyss](https://avatars.githubusercontent.com/u/44386082?v=4)](https://github.com/xudongyss "xudongyss (11 commits)")

### Embed Badge

![Health badge](/badges/xudongyss-phpoffice/health.svg)

```
[![Health](https://phpackages.com/badges/xudongyss-phpoffice/health.svg)](https://phpackages.com/packages/xudongyss-phpoffice)
```

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M712](/packages/maatwebsite-excel)[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[in2code/powermail

Powermail is a well-known, editor-friendly, powerful and easy to use mailform extension for TYPO3 with a lots of features

982.5M38](/packages/in2code-powermail)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
