关于imagestring()再问一次。。。。 这个函数为什么写入汉字就乱码?如何解决? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 看看ImageString的手册就知道了,第二个参数只能用内置或imageloadfont()载入的gdf字体,中文是不支持的 要显示中文需要借助字体库,显示一般用GD库的imagettftext函数,实测参考代码:header ("Content-type: image/png"); $str="中文字体显示"; //$pic=imagecreatefrompng("background.png"); $width=540;$height=340;$pic = imagecreatetruecolor($width,$height );$color=imagecolorallocate($pic,255,0,0);$back=imagecolorallocate($pic,0,0,0); imagettftext($pic,12, -90, 250, 150,$color,"C:/WINDOWS/Fonts/simhei.ttf",$str); imagepng($pic); imagedestroy($pic); 用imagettftext(),具体看手册 PHP xmlhttp编码问题?请看代码! 可以直接unset()数组吗? 求php截取字符串 关于php的请求转发 上海地区,急招PHP程序员!!! 求php做的域名转向代码? 请教框架页面里子框架如何取得父框架的id等变量? 本公司急需一个商城的购物系统(功能如下),价格不是问题,本人在上海(有具体联系方式) 谁能谈谈php与web services thinkphp替换页面问题 积分系统设计?? 关于php setcookie()函数的问题
$str="中文字体显示";
//$pic=imagecreatefrompng("background.png");
$width=540;
$height=340;
$pic = imagecreatetruecolor($width,$height );
$color=imagecolorallocate($pic,255,0,0);
$back=imagecolorallocate($pic,0,0,0);
imagettftext($pic,12, -90, 250, 150,$color,"C:/WINDOWS/Fonts/simhei.ttf",$str);
imagepng($pic);
imagedestroy($pic);