手机
当前位置:查字典教程网 >编程开发 >php教程 >產生圖片隨機字串
產生圖片隨機字串
摘要:

<?php

$base='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';

$words=5;

$rand_top=strlen($base)-1;

$string='';

header("Content-type:image/png");

$im=imagecreate($words*16,$words*5);

$black=imagecolorallocate($im,90,60,120);

$white=imagecolorallocate($im,255,255,255);

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

$idx=mt_rand(0,$rand_top);

imagestring($im,3,$i*15+2,mt_rand(0,$words*2),$base[$idx],$white);

}

imagepng($im);

imagedestroy($im);

?>

【產生圖片隨機字串】相关文章:

php生成圆角图片的方法

用在PHP里的JS打印函数

phplot生成图片类用法详解

如何使用PHP中的字符串函数

用 php 编写的日历

PHP 中执行系统外部命令

PHP4与PHP3中一个不兼容问题的解决方法

用PHP生成自己的LOG文件

PHP应用分页显示制作详细讲解

用PHP发电子邮件

精品推荐
分类导航