Home  >  Article  >  Backend Development  >  The image cannot be displayed because it contains errors. Solution

The image cannot be displayed because it contains errors. Solution

WBOY
WBOYOriginal
2016-07-29 09:00:55954browse

Verification code problem in php: Get the verification code report The image cannot be displayed because it has errors

Step 1: You can use ob_get_contents() to see if there is anything else output. If so, use ob_clean( ) just clear it

ob_clean() and put it above the header ( "Content-Type: image/{$Imagick->getImageFormat()}" );

Also:

1. Remove Chinese spaces as much as possible
2. Delete all spaces and press Enter before " to prevent html output

The above introduces the solution to the problem that the image cannot be displayed because of its own errors, including the relevant 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