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.