色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

PHP實現變色驗證碼實例

復制代碼 代碼如下:
<?php
header("Content-type: image/png,charset='utf-8'");
$im = imagecreatetruecolor(400, 30);
//白色
$white = imagecolorallocate($im, 255, 255, 255);
//紅色
$red = imagecolorallocate($im, 255, 0, 0);
//黑色
$black=imagecolorallocate($im, 0, 0, 0);
//綠色
$green=imagecolorallocate($im, 0, 255, 0);
//藍色
$blue=imagecolorallocate($im, 0, 0, 255);
$color_arr=array($green,$blue,$red);
$color=array_rand($color_arr);
$text = '我靠這驗證碼太變態啦';
$textlen=iconv_strlen($text,'utf-8');//計算字符串長度
//隨機截取兩個字符,變色顯示
$p1=rand(1,$textlen)-1;
while(($p2=rand(1,$textlen)-1)==$p1);
$w1=iconv_substr($text,$p1,1,'utf-8');
$w2=iconv_substr($text,$p1,1,'utf-8');
//字體文件 (PS:T不錯的php Q扣 主站蜘蛛池模板: 卢氏县| 民乐县| 读书| 广水市| 万源市| 隆安县| 赣州市| 宁城县| 阿勒泰市| 大兴区| 南涧| 栾川县| 建平县| 寿宁县| 类乌齐县| 台中市| 白朗县| 淮南市| 玛纳斯县| 盈江县| 宜丰县| 九寨沟县| 增城市| 巫山县| 鄄城县| 云龙县| 富源县| 静乐县| 聂拉木县| 泗水县| 武隆县| 建宁县| 昂仁县| 介休市| 从江县| 新竹县| 伊宁市| 文登市| 延长县| 西畴县| 高安市|