PHPackages                             phpcpj/phplib - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. phpcpj/phplib

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

phpcpj/phplib
=============

My php library

23155HTML

Since Feb 15Pushed 7y ago1 watchersCompare

[ Source](https://github.com/idcpj/phplib)[ Packagist](https://packagist.org/packages/phpcpj/phplib)[ RSS](/packages/phpcpj-phplib/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

安装
--

[](#安装)

为了方便自己开发新项目,收集项目中常用功能进行封装并用Composer进行下载

`composer require phpcpj/phplib dev-master`

文件目录介绍
------

[](#文件目录介绍)

### commom.php

[](#commomphp)

`encode` 解决json\_encode中文不转义 `createDir` 创建文件夹 `arraySort` 二维数组根据某个字段排序

### src - 类库存放文件

[](#src---类库存放文件)

**Curl.php**
------------

[](#curlphp)

1.用`curl`方法进行双向认证的类

**File.php**
------------

[](#filephp)

`downloadFile`方法 下载本地或网络资源

`createZip`方法 压缩文件

`ftp`方法 用php上传文件到ftp服务器

`sftp`方法 用php上传文件到stp服务器

**Umeng.php**
-------------

[](#umengphp)

`sendAndroidList`方法 安卓列播放

`sendIOSUnicast`方法 Ios单播

`sendIOSList`方法 Ios列表

**PHPExcel.php**
----------------

[](#phpexcelphp)

`exportExcel` 方法 数组转excel 并下载

`excelConvertData` 方法 解析excel 第二个参数设置删除空白行数据

**Pdf.php**
-----------

[](#pdfphp)

采用链式调用

中文文件名无法识别的问题

```
1、注释以下代码，大约在7565-7568行：

if ($dest[0] != 'F') {
	$name = preg_replace('/[\s]+/', '_', $name);
	$name = preg_replace('/[^a-zA-Z0-9_\.-]/', '', $name);
}

2、搜索该方法代码，替换如下代码，大约分别在7639、7670、7693、7718行。
	header('Content-Disposition: attachment; filename="'.basename($name).'"');
	替换为
	header('Content-Disposition: attachment; filename="'.$name.'"');
```

`setHeader` 设置页眉

`htmlToPdf` 设置html转pdf

`addImg` 添加图片

`showPdf` | `downPdf` | `savePdf` 展示 |下载| 保存到服务器

**Email.php**
-------------

[](#emailphp)

`addAttach` 添加附件地址

`sendEmail` 发送文件

**Alioss.php**
--------------

[](#aliossphp)

`ossUpload` 上传文件

`getUrl` 获取完整网络连接

`ossDeletObject` 删除oss上指定文件

**Md5Rsa**

md5形式的rsa证书加密

`_Sign` 对数据进行加密前的排序和 转为 `name=aaaaa&partner_id=2600833041` 形式

`_CreateSign` 对数据进行加密

`isValid` 对数据进行验证

`sendAction` 为要加密的数据创建新的sign键名 `$data['sign']`

### test

[](#test)

测试类库文件,分别对应src中的类库

### doc

[](#doc)

php 基础知识

### html

[](#html)

前端知识存放处

wiki
----

[](#wiki)

php 环境配置等请前往wiki

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 97.4% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/716e34b1f2b9316d1d7edd765cabe5c19a62d6802c863dcdbf5d0038f9ef0ba6?d=identicon)[陈鹏杰](/maintainers/%E9%99%88%E9%B9%8F%E6%9D%B0)

---

Top Contributors

[![idcpj](https://avatars.githubusercontent.com/u/20985264?v=4)](https://github.com/idcpj "idcpj (37 commits)")[![zfunnily](https://avatars.githubusercontent.com/u/35327768?v=4)](https://github.com/zfunnily "zfunnily (1 commits)")

### Embed Badge

![Health badge](/badges/phpcpj-phplib/health.svg)

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

PHPackages © 2026

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