21,882
社区成员
发帖
与我相关
我的任务
分享
<?php
error_reporting(E_ALL);
for ($i=0;$i<4;$i++)
{
$rand.=dechex(rand(1,15));
}
$im= ImageCreateTrueColor(100, 30);
//设置颜色
$bg=ImageColorAllocate($im, 0, 0, 0);
$te=ImageColorAllocate($im, 255, 255, 255);
//把字符串写在图象左上角
ImageString ($im, 5,0,0,$rand,$te);
//输出图象
header ('Content-type: image/png');
ImagePng($im);
ImageDestroy($im);
?>
<?php
error_reporting(E_ALL);
$rand=0;
for ($i=0;$i<4;$i++)
{
$rand.=dechex(rand(1,15));
}
$im= ImageCreateTrueColor(100, 30);
//设置颜色
$bg=ImageColorAllocate($im, 0, 0, 0);
$te=ImageColorAllocate($im, 255, 255, 255);
//把字符串写在图象左上角
ImageString ($im, 5,0,0,$rand,$te);
//输出图象
header ('Content-type: image/png');
ImagePng($im);
ImageDestroy($im);
?>