How can I use multiple PHP header content types on the same page? is this possible?

后端 未结 6 744
说谎
说谎 2020-12-06 21:38

Is it possible to use multiple header types in one document? For example:

header(\"Content-type: image/jpeg\");
header(\'Content-Type: text/html; charset=utf         


        
6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-06 22:27

    You can't. But what you can do is something like this in your HTML:

    
    

    Of course my_img.php would be a PHP file that has a header("Content-type: image/jpeg"); line, and outputs your image.

提交回复
热议问题