Pretty simple question: which one of these two PHP (version 5+) header call is the “best”?
header('Not Modified', true, 304);
header('HTTP/1.1 304 Not Modified');
I’m pretty sure the first one is the most polyvalent one, but just curious if PHP would “fix” the second one if under HTTP 1.0…
Thanks!
Edit: One of these header crashes PHP on my Web host. Follow-up question at:
PHP header() call "crashing" script with HTTP 500 error
I would use this one:
$_SERVER['SERVER_PROTOCOL']contains the protocol used in the request likeHTTP/1.0orHTTP/1.1.Edit I have to admit that my suggestion is senseless. After a few tests I noticed that if the first parameter is a valid HTTP status line, PHP will use that status line regardless if and what second status code was given with the third parameter. And the second parameter (documentation names it replace) is useless too as there can not be multiple status lines.
So the second and third parameter in this call are just redundant:
Use just this instead: