发送header数据
null Core_HttpIO::send_headers( )
public static function send_headers()
{
if (!headers_sent())
{
if (isset($_SERVER['SERVER_PROTOCOL']))
{
// Use the default server protocol
$protocol = $_SERVER['SERVER_PROTOCOL'];
}
else
{
// Default to using newer protocol
$protocol = 'HTTP/1.1';
}
if (HttpIO::$status != 200)
{
// HTTP status line
header($protocol . ' ' . HttpIO::$status . ' ' . HttpIO::$messages[HttpIO::$status]);
}
foreach (HttpIO::$headers as $name => $value)
{
if (is_string($name))
{
// Combine the name and value to make a raw header
$value = "{$name}: {$value}";
}
// Send the raw header
header($value, true);
}
}
}