The solution to the garbled code in PHP synthesized images: 1. Open the corresponding PHP code to generate images; 2. Clear the cached data before the header function by adding "ob_end_clean()".
#The operating environment of this article: Windows 7 system, PHP version 7.1, Dell G3 computer.
What should I do if the php synthesized image is garbled?
Generate the image under php, or the file is garbled
Foreword:
When we use PHP to generate excel or pictures, sometimes garbled characters will appear. Most of the Internet says to set the header, but it still has no effect after setting it. As follows:
Code
Effect
##Solution:
ob_end_clean() -------------Clear the cached data before the header function. Clear the cache and then output Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What should I do if php synthesized images appear garbled?. For more information, please follow other related articles on the PHP Chinese website!