Home  >  Article  >  Backend Development  >  What should I do if php synthesized images appear garbled?

What should I do if php synthesized images appear garbled?

藏色散人
藏色散人Original
2021-12-30 09:50:362261browse

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()".

What should I do if php synthesized images appear garbled?

#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:

What should I do if php synthesized images appear garbled?

Code

What should I do if php synthesized images appear garbled?

Effect

What should I do if php synthesized images appear garbled?

##Solution:

ob_end_clean() -------------Clear the cached data before the header function.

Clear the cache and then output

What should I do if php synthesized images appear garbled?

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!

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
Previous article:What does php param mean?Next article:What does php param mean?