<?php
header("Content-Type:text/html;charset=utf-8");
header("Content-Type:image/jpeg");
$image=imagecreate(250,100);
$bgcolor=imagecolorallocate($image,250,180,180);
$fontcolor=imagecolorallocate($image,30,30,30);
for($a=0;$a<4;$a++)
{
$rand.=dechex(rand(0,15));
}
$string=$rand;
imagettftext($image,50,7,40,80,$fontcolor,"./stcaiyun.ttf",$string);
imagejpeg($image);
imagedestroy($image);
?>代码运行后并不显示啊,只是出现“图像‘http:localhost:8080/test.php’因其本身有错无法显示”,求大神帮忙解答下问题到底出在哪? 最佳答案