función de PHP headers_list ()
Definición y Uso
headers_list () devuelve la función enviados (o para ser enviados) en respuesta a una lista de la cabeza.
Esta función devuelve una matriz que contiene la cabecera.
gramática
headers_list()
Notas y sugerencias
Consejo: Para determinar si el encabezado de transmisión función, uso headers_sent ().
Ejemplo 1
<?php
setcookie("TestCookie","SomeValue"');
header("X-Sample-Test: foo");
header('Content-type: text/plain');
?>
<html>
<body>
<?php
// What headers are to be sent?
var_dump(headers_list());
?>
</body>
</html>
setcookie("TestCookie","SomeValue"');
header("X-Sample-Test: foo");
header('Content-type: text/plain');
?>
<html>
<body>
<?php
// What headers are to be sent?
var_dump(headers_list());
?>
</body>
</html>
El código anterior es la salida:
array(4)
{
[0]=> string(23) "X-Powered-By: PHP/5.1.1"
[1]=> string(19) "Set-Cookie: TestCookie=SomeValue"
[2]=> string(18) "X-Sample-Test: foo"
[3]=> string(24) "Content-type: text/plain"
}
{
[0]=> string(23) "X-Powered-By: PHP/5.1.1"
[1]=> string(19) "Set-Cookie: TestCookie=SomeValue"
[2]=> string(18) "X-Sample-Test: foo"
[3]=> string(24) "Content-type: text/plain"
}
PHP Completo manual de referencia de HTTP