Home >Backend Development >PHP Problem >The pictures in the database in the php web page are garbled

The pictures in the database in the php web page are garbled

王林
王林Original
2019-10-21 10:49:203260browse

The pictures in the database in the php web page are garbled

The picture displays garbled characters

Reason:

Just add the following code to the header of the page , is used to declare the image type.

Solution:

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

Recommended tutorial: PHP video tutorial

The above is the detailed content of The pictures in the database in the php web page are 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:Learn what php can doNext article:Learn what php can do