如何解决php imagettftext 乱码问题

来自:互联网
时间:2020-10-14
阅读:

php 使用ImageTTFText 中文出现乱码:

可以用

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

来进行转码,再输出

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

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

返回顶部
顶部