Home > Backend Development > PHP Problem > What to do if php image output is garbled

What to do if php image output is garbled

藏色散人
Release: 2023-03-02 08:18:02
Original
3467 people have browsed it

Solution to garbled php image output: First open the corresponding file; then add the code statement "header("Content-Type:image/jpg");" to the head of the page. The statement is Used to declare the image type.

What to do if php image output is garbled

The picture displays garbled characters

Just add the following code to the head of the page, which is used to declare the picture type .

<?php
header("Content-Type:image/jpg");//图片编码设置
Copy after login

For more related articles, please visit PHP Chinese website!

The above is the detailed content of What to do if php image output is garbled. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template