如何解决php imagettftext 乱码问题

php imagettftext乱码的解决办法:首先通过“mb_convert_encoding”函数进行转码;然后通过语句“mb_convert_encoding($str, "UTF-8", "GB2312");”输出即可。

推荐:《PHP视频教程》

php 使用ImageTTFText 中文出现乱码:

可以用

string mb_convert_encoding ( string $str, string $to_encoding [, mixed $from_encoding] )

来进行转码,再输出

$str = mb_convert_encoding($str, "UTF-8", "GB2312");

确认一下文件是不是utf-8的。

hmoban主题是根据ripro二开的主题,极致后台体验,无插件,集成会员系统
自学咖网 » 如何解决php imagettftext 乱码问题