PHPackages                             yonghua4413/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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. yonghua4413/captcha

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

yonghua4413/captcha
===================

php验证码类,包含字母数字验证码，运算验证码,中文验证码, 由https://github.com/aknife2019/captcha 仓库进行改造。

v1.0.5(2y ago)011MITPHPPHP &gt;=8.2

Since Oct 24Pushed 2y agoCompare

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

READMEChangelogDependenciesVersions (3)Used By (0)

概述
--

[](#概述)

php验证码类，支持字母数字 、 运算符、中文验证码

字体：中文摘取常用100汉字和字母数字+运算符精简后的字体

未开启Imagick拓展时，动态图会变为静态图

[![demo](./images/1.gif)](./images/1.gif) [![demo](./images/2.gif)](./images/2.gif) [![demo](./images/3.gif)](./images/3.gif)

[![demo](./images/1.png)](./images/1.png) [![demo](./images/2.png)](./images/2.png) [![demo](./images/3.png)](./images/3.png)

安装
--

[](#安装)

```
composer require yonghua4413/captcha
```

快速入门
----

[](#快速入门)

示例代码

```
use Yonghua4413\captcha;

// 验证码配置
$config = [
    'type'      => 1, // 验证码类型(默认1) [1-字母数字, 2-算术, 3-中文]
    'width'     => 150, // 图片宽度(必填)
    'height'    => 80, // 图片高度(必填)
    'length'    => 4, // 验证码位数(默认5)
    'fontSize'  => 25, // 字体大小(默认25)
    'gif'       => 30, // 使用动图(默认30) [0-不启用,其他大于0的数字为gif帧速度]
    'uppercase' => 0, // 区分大小写(默认0) [0不区分，1区分]
    'session'   => 'demo' // session key $_SESSION['demo']['captcha']
];
// 输出图片
Captcha::create($config);

// 验证验证码
Captcha::check('验证码字符','demo');
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61.5% 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 ~0 days

Total

2

Last Release

928d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.6

v1.0.5PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/cb85c97a5e63452ebd778ce91754af516592215e85c2774b0a25c567c1a91e98?d=identicon)[yonghua4413](/maintainers/yonghua4413)

---

Top Contributors

[![yonghua4413](https://avatars.githubusercontent.com/u/20510201?v=4)](https://github.com/yonghua4413 "yonghua4413 (8 commits)")[![aknife2019](https://avatars.githubusercontent.com/u/50777910?v=4)](https://github.com/aknife2019 "aknife2019 (5 commits)")

---

Tags

captcha

### Embed Badge

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

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

###  Alternatives

[karser/karser-recaptcha3-bundle

Google ReCAPTCHA v3 for Symfony

1862.4M7](/packages/karser-karser-recaptcha3-bundle)[laminas/laminas-captcha

Generate and validate CAPTCHAs using Figlets, images, ReCaptcha, and more

2318.5M43](/packages/laminas-laminas-captcha)[captcha-com/symfony-captcha-bundle

Symfony Captcha Bundle -- BotDetect PHP CAPTCHA generator integration for the Symfony framework.

3991.6k](/packages/captcha-com-symfony-captcha-bundle)[abanoubnassem/filament-grecaptcha-field

Provides a Google reCaptcha V2 field for the Filament Forms

27116.1k2](/packages/abanoubnassem-filament-grecaptcha-field)[aryehraber/statamic-captcha

Protect your Statamic forms using a Captcha service

16194.4k](/packages/aryehraber-statamic-captcha)[mobicms/captcha

A simple PHP CAPTCHA library

2616.4k2](/packages/mobicms-captcha)

PHPackages © 2026

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