【php开源代码栏目提醒】:网学会员为需要php开源代码的朋友们搜集整理了showchinese.php相关资料,希望对各位网友有所帮助!
<?php
Header("Content-type: image/png");
$im = imagecreate(100,100);
$bkg = ImageColorAllocate($im, 0,0,0);
$clr = ImageColorAllocate($im, 255,255,255);
// 不同系统操作
系统路径不一样
$fnt = "c:/windows/fonts/simhei.ttf";
$str = chr(0xE4).chr(0xB8).chr(0xAD).chr(0xE6).chr(0x96).chr(0x87)."OK";
// "中文OK" in UTF-8
ImageTTFText($im, 20, 0, 10, 30, $clr, $fnt, $str);
Imagepng($im);
ImageDestroy($im);
?>