Is there any way to get the HTTP response code that will be sent from inside a PHP script, e.g., a script like this:
header('HTTP/1.1 404 Not Found');
$code = imaginary-function(); // $code contains 404
I noticed the http_response_code function in the PHP docs, but that doesn’t seem to be available in PHP 5.3.9.
Thanks in advance!
It has apparently been added in PHP 5.4, but I have not verified this.