国产探花免费观看_亚洲丰满少妇自慰呻吟_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);

?>

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 剑河县| 思茅市| 抚州市| 聊城市| 朝阳区| 沭阳县| 诏安县| 永春县| 沂源县| 佳木斯市| 临江市| 中超| 隆子县| 大田县| 苗栗市| 泉州市| 富裕县| 高唐县| 政和县| 渑池县| 广汉市| 宣威市| 天全县| 武隆县| 茂名市| 武汉市| 娱乐| 揭东县| 五莲县| 苏尼特左旗| 孝昌县| 文化| 淅川县| 潼关县| 德安县| 天等县| 赫章县| 西华县| 绵阳市| 临海市| 杭锦后旗|