代码如下:记得要存为utf-8编码文件,否则汉字显示乱码
<?
header("Content-type: image/jpeg");
$im = imagecreate(500,30);
$white = imagecolorallocate($im, 255,255,0);
$black = imagecolorallocate($im, 0,0,255);
// Replace path by your own font path
imagettftext($im, 20, 0, 10, 20, $black, "C:/windows/fonts/simsun.ttc",
"Testing...你好,方块字!...");
imagejpeg($im);
imagedestroy($im);
?>
<?
header("Content-type: image/jpeg");
$im = imagecreate(500,30);
$white = imagecolorallocate($im, 255,255,0);
$black = imagecolorallocate($im, 0,0,255);
// Replace path by your own font path
imagettftext($im, 20, 0, 10, 20, $black, "C:/windows/fonts/simsun.ttc",
"Testing...你好,方块字!...");
imagejpeg($im);
imagedestroy($im);
?>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货