用gd库怎么把中文写进图片里? 把文件保存成utf-8编码的就行了! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 谢谢您的回复,要把哪个文件存成utf-8呢?我的还是不行,能帮忙看看错哪了么?我的两个页面是这样的###gd.php<?php Header("Content-type: image/png"); $width = 7.5*(strlen($_GET["text"]))+100; $text = $_GET["text"]; $height = 21; $newim = imagecreate($width,$height); $gray = imagecolorallocate($newim,153,153,153); $white = ImageColorAllocate($newim,255,255,255); imagefilledrectangle($newim,1,1,$width-96,19,$white); $email = imagecreatefrompng('gmail.png'); imagecopy($newim,$email,$width-100,0,1,0,100,21); imagestring($newim, 3, 7, 3, $text, $gray); imagepng($newim); imagedestroy($newim);?> ###index.php<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><body><p>请输入你的Gmail地址:</p><form action="index.php" method="get" name="email"><input type="text" name="text" width="100">@gmail.com<input type="submit" value="创建我的签名"></form><table style="display:<?php if(empty($_GET["text"])) echo "none;";?>"><tr><td><img src="gd.php?text=<?php echo $_GET["text"]?>" ></td></tr></table></body></html> 本版搜以前的帖子。gd中文问题问了n次。 求一个简单的正则表达式 svn的一个checkout使用问题 请问php怎么调用Sql server中自定义的函数,谢谢 帮我写个涵数用正则取得里面的图片文件名! 为什么我不能用imagettfbbox函数? session名和其他变量名字重复的问题 写的邮件系统发不出邮件 关于注册系统自动回复确认信的问题 现在还有多少PHP好站? 站里下载的连接能用的不多了。 新手提问:在WinMe下安装php 菜鸟对计数器的问题 请问我应该用什么数据类型?
我的两个页面是这样的
###gd.php
<?php Header("Content-type: image/png");
$width = 7.5*(strlen($_GET["text"]))+100;
$text = $_GET["text"];
$height = 21;
$newim = imagecreate($width,$height);
$gray = imagecolorallocate($newim,153,153,153);
$white = ImageColorAllocate($newim,255,255,255);
imagefilledrectangle($newim,1,1,$width-96,19,$white);
$email = imagecreatefrompng('gmail.png');
imagecopy($newim,$email,$width-100,0,1,0,100,21);
imagestring($newim, 3, 7, 3, $text, $gray);
imagepng($newim);
imagedestroy($newim);?> ###index.php
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head><body>
<p>请输入你的Gmail地址:</p>
<form action="index.php" method="get" name="email">
<input type="text" name="text" width="100">@gmail.com
<input type="submit" value="创建我的签名">
</form><table style="display:<?php if(empty($_GET["text"])) echo "none;";?>"><tr><td>
<img src="gd.php?text=<?php echo $_GET["text"]?>" >
</td></tr></table></body>
</html>