php绘制中文的乱码问题
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->
<?php
// 1.
$img=imagecreatetruecolor(400,400);
$white=imagecolorallocate($img, 255, 255, 255);
$gray=imagecolorallocate($img, 0xC0, 0xC0, 0xC0);
$darkgray=imagecolorallocate($img, 0x90, 0x90, 0x90);
$navy=imagecolorallocate($img, 0, 0, 0x80);
$darknavy=imagecolorallocate($img, 0, 0, 0x50);
$red= imagecolorallocate($img, 0xFF, 0, 0);
$darkred=imagecolorallocate($img, 0x90, 0, 0);
// 2.
imagefill($img,0,0,$red);
imagettftext($img,20,-60,60,150,$darknavy,"simhei.ttf","一二三");
// 3.
header("Content-Type:image/gif");
imagegif($img);
// 4.
imagedestroy($img);
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号