I am trying to send http headers. I have used both
header(“HTTP/1.0 404 Not Found”);
and
http_response_code(404);
Both work fine. But both seem to send the error code multiple times (4 times, to be exact) when I monitor the http responses via HttpFox.
But if I use this code, found on the http_response_code page (http://us1.php.net/http_response_code)
// Get the current default response code
var_dump(http_response_code()); // int(200)
// Set our response code
http_response_code(404);
// Get our new response code
var_dump(http_response_code()); // int(404)
I only monitor one response from the server.
Can someone explain to me if this is normal behavior, and if not, what I should be doing?