Is there any way to get the current HTTP response code from PHP?
<p>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:</p>

<pre><code>header('HTTP/1.1 404 Not Found');

$code = imaginary-function(); // $code contains 404
</code></pre>

<p>I noticed the <code>http_response_code</code> function in the PHP docs, but that doesn't seem to be available in PHP 5.3.9.</p>

<p>Thanks in advance!</p>
