PHP Class Cml\Vendor\VerifyCode

Show file Open project: linhecheng/cmlphp

Public Methods

Method Description
CnVerify ( integer $length = 4, string $type = 'png', integer $width = 180, integer $height = 50, string $font = 'tahoma.ttf', string $verifyName = 'verifyCode' ) : void 中文验证码
calocVerify ( string $type = 'png', integer $width = 170, integer $height = 45, string $font = 'tahoma.ttf', string $verifyName = 'verifyCode' ) : void 生成数字计算题验证码
checkCode ( string $input, boolean $isCn = false, string $verifyName = 'verifyCode' ) : boolean 校验验证码
numVerify ( integer $length = 4, string $type = 'png', integer $width = 150, integer $height = 35, string $verifyName = 'verifyCode', string $font = 'tahoma.ttf' ) : void 生成图像数字验证码
output ( resource &$image, string $type = 'png', string $filename = null, integer $quality = 100 ) : void 输出图片

Method Details

CnVerify() public static method

中文验证码
public static CnVerify ( integer $length = 4, string $type = 'png', integer $width = 180, integer $height = 50, string $font = 'tahoma.ttf', string $verifyName = 'verifyCode' ) : void
$length integer
$type string
$width integer
$height integer
$font string
$verifyName string
return void

calocVerify() public static method

生成数字计算题验证码
public static calocVerify ( string $type = 'png', integer $width = 170, integer $height = 45, string $font = 'tahoma.ttf', string $verifyName = 'verifyCode' ) : void
$type string
$width integer
$height integer
$font string
$verifyName string
return void

checkCode() public static method

校验验证码
public static checkCode ( string $input, boolean $isCn = false, string $verifyName = 'verifyCode' ) : boolean
$input string 用户输入
$isCn boolean 是否为中文验证码
$verifyName string 生成验证码时的字段
return boolean 正确返回true,错误返回false

numVerify() public static method

生成图像数字验证码
public static numVerify ( integer $length = 4, string $type = 'png', integer $width = 150, integer $height = 35, string $verifyName = 'verifyCode', string $font = 'tahoma.ttf' ) : void
$length integer 位数
$type string 图像格式
$width integer 宽度
$height integer 高度
$verifyName string Cookie中保存的名称
$font string 字体名
return void

output() public static method

输出图片
public static output ( resource &$image, string $type = 'png', string $filename = null, integer $quality = 100 ) : void
$image resource 被载入的图片
$type string 输出的类型
$filename string 保存的文件名
$quality integer jpeg保存的质量
return void