/    Sign up×
Community /Pin to ProfileBookmark

How to detect which own default Content-Type header is server sending?

How to detect which own default Content-Type header is server sending?

Code is to fix this like:

[code=php]
<?php
header(‘Content-Type: text/html; charset=”utf-8″‘, true);
[/code]

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiApr 28.2009 — [code=php]var_dump(headers_list());[/code]
Copy linkTweet thisAlerts:
@toplisekauthorApr 28.2009 — this will dump or ECHO own default Content-Type header which is server sending
Copy linkTweet thisAlerts:
@MindzaiApr 28.2009 — If that isn't what you want then I don't understand what you're asking.
Copy linkTweet thisAlerts:
@NogDogApr 28.2009 — If you are asking how to know from within PHP what headers the web server is going to send if you do not override them, I do not know of any built-in way to do that other than to request a file from your server via cURL and see what the headers are.

But ultimately, why should you care? Just set the headers you want to use and then you don't have to worry about it.
Copy linkTweet thisAlerts:
@toplisekauthorApr 28.2009 — Exact NogDog:

[B]how to know from within PHP what headers the web server is going to send if you do not override them[/B]

Sorry Mindzai if I was not clear.
×

Success!

Help @toplisek spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...