代码:
$im = imagecreatefromjpeg("ok.jpg");
$black = @imagecolorallocate($im, 0,0,0);
$jpgnumid = "这是嵌入到图片的文字,解决了乱码问题,
上面的ok.jpg是同目录下的照片.使用它时,还需要有iconv
模块!也就是说在php.ini里将
[iconv]
iconv.input_encoding = ISO-8859-1
iconv.internal_encoding = ISO-8859-1
iconv.output_encoding = ISO-8859-1
这三行的注释全部去掉! ";
$jpgnumid = @iconv("GB2312","UTF-8",$jpgnumid);
@imagettftext ($im,25,0,0,500,$black,"MissYuan_迷你简菱心.TTF",$jpgnumid);header("Content-type: image/jpeg");imagejpeg($im);imagedestroy($im);?>