為什么顯示因錯誤無發(fā)顯示呢
<?php
? $image = imagecreatetruecolor(100,30);
? $bgcolor = imagecolorallocate($image,255,255,255);
? imagefill($image,0,0,$bgcolor);
?
? for($i=0;$i<4;$i++){
?? ?$fontsize = 6;
?? ?$fontcolor = imagecolorallocate($image,rand(0,120),rand(0,120),rand(0,120)) ;
?? ?$fontcontent = rand(0,9);
?? ?
?? ?$x = ($i*100/4) + rand(5,10);
?? ?$y = rand(5,10);
?? ?
?? ?imagestring($image,$fontsize,$x,$y,$fontcontent,$color);
?? ?
? }
?
?
?
?
? header('content-type:image/png');
? imagepng($image);
?
? imagedestroy($image);
?>
2017-02-17
imagestring($image,$fontsize,$x,$y,$fontcontent,$fontcolor);
你的寫成了$color;
2016-12-13
可以顯示啊,你是在localhost里面打開的嗎?