Home >Backend Development >PHP Tutorial >The problem of Chinese garbled characters when generating text watermarks in PHP. Making watermark text in PS. Text watermark. How to make watermark text.

The problem of Chinese garbled characters when generating text watermarks in PHP. Making watermark text in PS. Text watermark. How to make watermark text.

WBOY
WBOYOriginal
2016-07-29 08:50:281252browse

In the past two days, I helped my colleagues test the effect of synthesizing pictures and text. There was no problem with the picture synthesis, but when I synthesized the text, I encountered a small problem. The Chinese characters were always garbled. I thought at first that the header declaration utf-8 was not added. After adding it, I found that Still didn't work, and then I used iconv to convert the text to be generated into utf-8, but it still didn't work. After searching, I finally found that there was a problem with the function used to generate text. I used this imagestring() before. It seems that this function is not suitable for Chinese. It’s so supportive, I’ll just switch to ImageTTFText.

The above introduces the problem of Chinese garbled characters when PHP generates text watermarks, including text watermarks and PHP content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn