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

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

復(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 = '我靠這驗證碼太變態(tài)啦';
$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扣 主站蜘蛛池模板: 安岳县| 黄大仙区| 华坪县| 武川县| 阳江市| 遂昌县| 来安县| 高唐县| 五华县| 利川市| 正宁县| 台中市| 武穴市| 井陉县| 偃师市| 措勤县| 本溪市| 吉水县| 富源县| 五常市| 新巴尔虎左旗| 霍林郭勒市| 乐昌市| 宝兴县| 岳阳市| 建湖县| 积石山| 南澳县| 文安县| 息烽县| 东辽县| 昭通市| 宁化县| 阳朔县| 乌兰察布市| 黑水县| 平乐县| 南乐县| 庐江县| 岳池县| 康定县|