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

后端 未结 6 740
说谎
说谎 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条回答
  •  佛祖请我去吃肉
    2020-12-06 22:20

    You can't use both at the same time, but you could optionally use one or the other based on a query parameter or similar.

    In regards to using both types of content in one page - in a normal HTML page with elements, for example, those are separate HTTP requests so they have their own Content-Type header.

    Not exactly sure what you're trying to achieve here...

提交回复
热议问题