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

PHP實(shí)現(xiàn)變色驗(yàn)證碼實(shí)例

復(fù)制代碼 代碼如下:
<?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);
//藍(lán)色
$blue=imagecolorallocate($im, 0, 0, 255);
$color_arr=array($green,$blue,$red);
$color=array_rand($color_arr);
$text = '我靠這驗(yàn)證碼太變態(tài)啦';
$textlen=iconv_strlen($text,'utf-8');//計(jì)算字符串長(zhǎng)度
//隨機(jī)截取兩個(gè)字符,變色顯示
$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不錯(cuò)的php Q扣 主站蜘蛛池模板: 辉南县| 页游| 桃园市| 永清县| 县级市| 萨嘎县| 宣武区| 兴城市| 垣曲县| 资中县| 涪陵区| 兴文县| 汤原县| 同心县| 大悟县| 昭通市| 松溪县| 临洮县| 汝州市| 老河口市| 农安县| 公安县| 仁化县| 通辽市| 扎赉特旗| 宜春市| 定兴县| 兴安盟| 融水| 湟中县| 丰顺县| 尚志市| 枣阳市| 象山县| 元朗区| 汶上县| 襄垣县| 崇仁县| 东城区| 收藏| 出国|