Properties

$seKey

$seKey : 

Type

$expire

$expire : 

Type

$useZh

$useZh : 

Type

$useImgBg

$useImgBg : 

Type

$fontSize

$fontSize : 

Type

$useCurve

$useCurve : 

Type

$useNoise

$useNoise : 

Type

$imageH

$imageH : 

Type

$imageL

$imageL : 

Type

$length

$length : 

Type

$fontttf

$fontttf : 

Type

$bg

$bg : 

Type

$_codeSet

$_codeSet : string

验证码中使用的字符,01IO容易混淆,建议不用

Type

string

$_image

$_image : 

Type

$_color

$_color : 

Type

Methods

check()

check(string  $code,   $id = '') : boolean

验证验证码是否正确

Parameters

string $code

用户验证码

$id

Returns

boolean —

用户验证码是否正确

entry()

entry(  $id = '') 

输出验证码并把验证码的值保存的session中 验证码保存到session的格式为: array('code' => '验证码值', 'time' => '验证码创建时间');

Parameters

$id

_writeCurve()

_writeCurve() 

画一条由两条连在一起构成的随机正弦函数曲线作干扰线(你可以改成更帅的曲线函数)

高中的数学公式咋都忘了涅,写出来 正弦型函数解析式:y=Asin(ωx+φ)+b 各常数值对函数图像的影响: A:决定峰值(即纵向拉伸压缩的倍数) b:表示波形在Y轴的位置关系或纵向移动距离(上加下减) φ:决定波形与X轴位置关系或横向移动距离(左加右减) ω:决定周期(最小正周期T=2π/∣ω∣)

_writeNoise()

_writeNoise() 

画杂点 往图片上写不同颜色的字母或数字

_background()

_background() 

绘制背景图片 注:如果验证码输出图片比较大,将占用比较多的系统资源

authcode()

authcode(  $str) 

Parameters

$str