PHP 驗證碼類

2021-08-21 11:30:15 字數 1353 閱讀 2937

呼叫方法:

$captcha = new captcha();

$captcha->createcaptcha();

**:

<?php

/** * created by phpstorm.

* user: ming

* date: 2018/7/15

* time: 下午4:34

*/class captcha

/*** createcode

* @return string:生成的驗證碼字串

*/protected function createcode()

}public function __get($name)

}public function __destruct()

/*** typestr 返回對用型別的字串

* @param $type 0:number, 1:lowercase, 2:toupper

* @return string

*/protected function typestr($type)

/*** randstr 返回打亂後的字串

* @param $str

* @return string

*/protected function randstr($str)

/*** numbercode

* @return string:數字驗證碼

*/protected function numbercode()

/*** lettercode

* @return string:字母驗證碼

*/protected function lettercode()

/*** @return string:數字字母混合驗證碼

*/protected function numletcode()

/*** createcaptcha:生成驗證碼

*/public function createcaptcha()

protected function createimage()

protected function fillcolor()

protected function tone($rank)

protected function lightcolor()

protected function darkcolor()

protected function fillcode()

}protected function filldisturb()

}protected function showimage()

}

PHP驗證碼類

php驗證碼類 如果不適用指定的字型,那麼就用imagestring 函式,如果需要遇到指定的字型,就要用到imagettftext 函式。字型的位置在c盤下windows fonts.verificationcode.class.php class verificationcode 生成驗證碼 p...

php驗證碼類

1 驗證碼類檔案 createimg.class.php class validationcode function outimg private function outfileheader private function createcode private function createim...

php 驗證碼生成類

created on 2013 7 19 驗證碼類 通過類的物件可以動態獲取驗證碼和驗證正碼字串。class validationcode 顯示並向瀏覽器輸出影象 function showimage function getcheckcode 建立影象 private function getcr...