国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > 建站經驗 > 正文

php生成數字字母的驗證碼圖片

2024-04-25 20:39:05
字體:
來源:轉載
供稿:網友

php生成數字字母的驗證碼圖片

<?php

header ('Content-Type: image/png');

$image=imagecreatetruecolor(100, 30);

$color=imagecolorallocate($image, 255, 255, 255);

imagefill($image, 20, 20, $color);

//只含有數字

// for($i=0;$i<4;$i++){

// $font=6;

// $x=rand(5,10)+$i*100/4;

// $y=rand(8, 15);

// $string=rand(0, 9);

// $color=imagecolorallocate($image, rand(0,120), rand(0,120), rand(0,120));

// imagestring($image, $font, $x, $y, $string, $color);

// }

//含有數字和字母的

for($i=0;$i<4;$i++){

$fontSize=6;

$x=rand(5,10)+$i*100/4;

$y=rand(5, 15);

$data='abcdefghijklmnopqrstuvwxyz123456789';

$string=substr($data,rand(0, strlen($data)),1);

$color=imagecolorallocate($image,rand(0,120), rand(0,120), rand(0,120));

imagestring($image, $fontSize, $x, $y, $string, $color);

}

//干擾點元素

for($i=0;$i<200;$i++){

$pointColor=imagecolorallocate($image, rand(100, 255), rand(100, 255), rand(100, 255));

imagesetpixel($image, rand(0, 100), rand(0, 30), $pointColor);

}

//干擾線元素

for($i=0;$i<2;$i++){

$linePoint=imagecolorallocate($image, rand(150, 255), rand(150, 255), rand(150, 255));

imageline($image, rand(10, 50), rand(10, 20), rand(80,90), rand(15, 25), $linePoint);

}

imagepng($image);

imagedestroy($image);

?>

以上所述就是本文的全部內容了,希望大家能夠喜歡。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 高碑店市| 凤凰县| 竹山县| 房山区| 吉水县| 乐昌市| 巴林右旗| 称多县| 湖北省| 马边| 安国市| 峨眉山市| 斗六市| 保德县| 大丰市| 桂东县| 招远市| 韶山市| 神木县| 施秉县| 周口市| 峨眉山市| 南通市| 称多县| 兰西县| 土默特右旗| 延长县| 清流县| 宣恩县| 遂溪县| 镇远县| 榆林市| 青海省| 涞水县| 弥渡县| 灵寿县| 怀集县| 织金县| 蒲江县| 建湖县| 沙坪坝区|