- function_exists: documentation ( source)
- headers_sent: documentation ( source)
- header: documentation ( source)
<?php
if (!function_exists('http_response_codea'))
{
function http_response_codea($newcode = NULL)
{
static $code = 200;
if($newcode !== NULL)
{
header('X-PHP-Response-Code: '.$newcode, true, $newcode);
if(!headers_sent())
$code = $newcode;
}
return $code;
}
}
echo http_response_codea(404);