How to change content type in php?

前端 未结 2 1121
醉话见心
醉话见心 2020-12-16 11:51

I have an image, but it keep doesn\'t display. I check the image properties (right-click and chose properties), and the I found the \"type\" is text/html not JPEG image. Is

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-16 12:25

    header('Content-Type: image/jpeg');
    

    Make sure to call the header() function before doing any output or you will get a "Headers already sent" error.

提交回复
热议问题