waljqiang / captcha
captcha library for php
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/waljqiang/captcha
Requires
- php: >=5.5
This package is auto-updated.
Last update: 2025-09-29 02:49:32 UTC
README
captcha library for php
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Nova\Captcha\Captcha;
$captcha = new Captcha(
[
'fontSize' => 18,
'length' => 4,
'useNoise' => false,
'codeSet' => '0123456789',
'imageW' => 130,
'imageH' => 50,
'fontttf' => '5.ttf'
]
);
$code = $captcha->entry();
file_put_contents('11.txt',json_encode($code));
$captcha->getImage();
//验证
/*$code = json_decode(file_get_contents('11.txt'),true);
$captcha = new Captcha();
$rs = $captcha->check($code,'0606');
var_dump($rs);*/