<?php
session_start();
for($i=0;$i
$_nmsg.= dechex(mt_rand(0,15));
}
$_SESSION['code']=$_nmsg;
$_width=75;
$_height=25;
$_img=imagecreatetruecolor($_width,$_height);
$_white=imagecolorallocate($_img,255,255,255);
imagefill($_img,0,0,$_white);
header('Content-Type:image/png');
imagepng($_img);
imagedestroy($_img);
?>
用php生成一张图片,但是显示不出来
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
3条回答 默认 最新
- qq_21519767 2015-04-21 05:34关注
这个php文件要保证编码为utf-8,其他不行的。然后直接访问这文件或者放在html的img标签里
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报