You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
397 B
PHP
15 lines
397 B
PHP
<?php
|
|
|
|
// For 4.3.0 <= PHP <= 5.4.0
|
|
if (function_exists('http_response_code') === false) {
|
|
function http_response_code($newcode = NULL) {
|
|
static $code = 200;
|
|
if ($newcode !== NULL) {
|
|
header('X-PHP-Response-Code: ' . $newcode, true, $newcode);
|
|
if (!headers_sent()) {
|
|
$code = $newcode;
|
|
}
|
|
}
|
|
return $code;
|
|
}
|
|
} |