先演示一下:
今天刚写的,还热乎着呢,代码如下:
= 128)
{
if($x+32>500)
{
$x=1;
$y=40+$count*41;
$count++;
}
$temp=$txt[$t++].$txt[$t];
$temp=mb_convert_encoding($temp, utf-8, gb2312);
imagettftext($im,24, 0, $x, $y, $color,tupian/finish/simsun.ttc,$temp);
$x+=32;
}
else
{
if($x+8>500)
{
$x=1;
$y=40+$count*41;
$count++;
}
imagettftext($im,24, 0, $x, $y, $color,tupian/finish/simsun.ttc,$txt[$t]);
$x+=16;
}
}
imagepng($im);
imagedestroy($im);
?>
使用说明:将上面的代码保存为1.php!
1、在浏览器中输入http://你的网址/1.php?txt=文字 可直接观看效果
2、在论坛中以这样的形式发帖:{img}http://你的网址/1.php?txt=文字{/img}(实际用时把大括号换为中括号)
ps:如果你的空间不支持mb_convert_encoding函数,你需要有把gb2312转为utf-8的函数才能支持中文!
http://www.bkjia.com/phpjc/508496.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/508496.htmltecharticle先演示一下: 今天刚写的,还热乎着呢,代码如下: ?php header(content-type: image/png); $txt=$_get[txt].(刷新我会变色哦); $i=strlen($txt); $width=16*str...