PHPackages                             lovefc/captcha - 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. lovefc/captcha

ActiveLibrary

lovefc/captcha
==============

php中文验证码

0.0.4(3y ago)53003MITPHPPHP &gt;=5.6.0

Since Sep 29Pushed 3y ago1 watchersCompare

[ Source](https://github.com/lovefc/captcha)[ Packagist](https://packagist.org/packages/lovefc/captcha)[ Docs](https://github.com/lovefc/captcha.git)[ RSS](/packages/lovefc-captcha/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

PHP动态验证码
========

[](#php动态验证码)

使用简单方便，增加你的摸鱼时间。

自动判断中英文，中文时为中文随机数，英文时为英文随机数

[![avatar](/image/1.gif)](/image/1.gif)

[![avatar](/image/2.gif)](/image/2.gif)

[![avatar](/image/3.gif)](/image/3.gif)

[![avatar](/image/4.gif)](/image/4.gif)

验证码字体是开源的站酷库黑体(中英文皆可用)，感谢站酷免费提供。

### 安装

[](#安装)

直接下载源码或者使用 composer 安装

```
{
    "require": {
        "lovefc/captcha": "0.0.3"
    }
}

```

### 食用方法

[](#食用方法)

```

/* 实例化 */
$ver = new FC\Captcha();

/* 验证码的一些设置 */

// 验证码宽度
$ver->width = 300;

// 验证码高度
$ver->height = 100;

// 验证码个数
$ver->nums = 4;

// 随机字符串
$ver->random = '舔狗不得好死';

// 随机数大小
$ver->font_size = 40;

// 干扰线数量，为0时没有干扰线
$ver->interfere_line = 50;

// 字体路径
//$ver->font_path = __DIR__.'/Font/zhankukuhei.ttf';

// 是否为动态验证码
//$ver->is_gif = true;

// 动图帧数
//$ver->gif_fps = 10;

/* 生成验证码 */
$code = $ver->getCode();

/*
 $_SESSION['code'] = $code
 ....(这里自己存Session或者Redis)
*/

/* 生成验证码图片 */
$ver->doImg($code);

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

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

Every ~336 days

Total

4

Last Release

1410d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/29d97b6587197b373f7244e3d4a84e6944ffd971ff10a88256c39432e3fb8936?d=identicon)[lovefc](/maintainers/lovefc)

---

Top Contributors

[![lovefc](https://avatars.githubusercontent.com/u/18413965?v=4)](https://github.com/lovefc "lovefc (8 commits)")

---

Tags

captchaphpphpcaptcha

### Embed Badge

![Health badge](/badges/lovefc-captcha/health.svg)

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

PHPackages © 2026

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