最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
PHP 生成中文验证码乱码问题解决
时间:2022-06-25 00:00:49 编辑:袖梨 来源:一聚教程网
//将要处理的汉字,先由UTF8的汉字转成html实体形式再使用.
//示例代码:
代码如下 | 复制代码 |
//ini_set('JIS-mapped Japanese Font Support',false); $pic=imagecreate(250,30); $black=imagecolorallocate($pic,0,0,0); $white=imagecolorallocate($pic,255,255,255); $font="C://WINDOWS//Fonts//simhei.ttf"; |
$str = '中华人民共和国';
$str = mb_convert_encoding($str, "html-entities","utf-8" );//结果:哪一队优先开球
代码如下 | 复制代码 |
imagettftext($pic,10,0,10,20,$white,$font,$str); header("Content-type: image/jpeg"); |
//pChart 示例代码:
/*
Example14: A smooth flat pie graph
*/
代码如下 | 复制代码 |
// Standard inclusions // Initialise the graph // Draw the pie chart $Test->Render("example14.png"); /** |
相关文章
- 地下城堡4骑士与破碎编年史初光神官有哪些流派 09-17
- 嘟嘟脸恶作剧克萝伊技能怎么样 09-17
- 新三国志曹操传驯马场有什么玩法 09-17
- 全境封锁曙光武器怎么获取 09-17
- 鹅鸭杀丧葬者如何玩 09-17
- 剑与远征启程沙利叶强技能怎么样 09-17