In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to solve the php gd garbled problem". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to solve the php gd garbled problem".
Php gd garbled solutions: 1, through the "iconv ('gb2312','utf-8','')" conversion code; 2, call imagettftext () function output Chinese string can.
This article operating environment: windows7 system, PHP7.1 version, DELL G3 computer
What about the php gd garbled code?
Solve the problem of garbled codes in GD:
Today, I carefully studied some related technologies of GD, and also studied the problem of Chinese garbled code in GD.
Using the GD library to output Chinese strings, it is useless to call imagestring. The imagettftext () function is required. The specific use of the imagettftext function is referred to the manual.
Here is a use example:
$pic=imagecreate (250,05,30); $black=imagecolorallocate ($pic,0,0,0); $white=imagecolorallocate ($pic,255255255); $font= "C://WINDOWS//Fonts//simhei.ttf"; / / the path here must be the path of the character $str = 'php'.iconv (' gb2312','utf-8',' facing object'). "www.phpobject.net"; imagettftext ($pic,10,0,10,20,$white,$font,$str)
Earlier, I gave a simple example of GD watermarking, which only illustrates how to use a picture to watermark. Here is a simple code for text watermarking.
Thank you for your reading, the above is the content of "how to solve the php gd garbled problem", after the study of this article, I believe you have a deeper understanding of how to solve the php gd garbled problem, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.