headers_list

(PHP 5, PHP 7)

headers_listRetorna uma lista de cabeçalhos enviados para o servidor (ou pronto para enviar)

Descrição

array headers_list ( void )

headers_list() Irá retornar uma lista de cabeçalhos a serem enviados para o navegador / cliente. Para determinar se esses cabeçalhos têm ou ainda não foram enviados, use headers_sent().

Valor Retornado

Retorna um array indexado de cabeçalhos.

Exemplos

Exemplo #1 Exemplos usando headers_list()

<?php

/* setcookie() Irá adicionar um cabeçalho de resposta por conta própria */
setcookie('foo''bar');

/* Define um cabeçalho de resposta personalizado
   Isso será ignorado pela maioria dos clientes */
header("X-Sample-Test: foo");

/* Específica o conteúdo de texto simples em nossa resposta */
header('Content-type: text/plain');

/* Quais cabeçalhos serão enviados? */
var_dump(headers_list());

?>

O exemplo acima irá imprimir:

array(4) {
  [0]=>
  string(23) "X-Powered-By: PHP/5.1.3"
  [1]=>
  string(19) "Set-Cookie: foo=bar"
  [2]=>
  string(18) "X-Sample-Test: foo"
  [3]=>
  string(24) "Content-type: text/plain"
}

Notas

Nota:

Headers só serão acessíveis e retornados quando a SAPI que os suporta estiver em uso.

Veja Também

Magir Basibuces amp;redirect=hcournar33>

ass="note">s_sent &raquetorlass=11033href">s_sent &raqvss="note"nction.headVu11033hre height="24" al='add avss=BR/functiohea11033h.php.nn.headers-list" class="re.php.vss==u href="httV Heup! HTTP rese.php?sec-vss=u">up class="refnamedivnction.headVd11033hre height="24" al='add avss=BR/functiohea11033h.php.nn.headers-list" class="re.php.vss==menthref="httV Hement! HTTP rese.php?sec-vss=lisment class="refnamedivnction.ss="refsp> yrlass=V11033hrref="htt72% liked="is...re heig16ut-content">
());
r />/* ronto keyword00/div> >
());
r /a: :FF8000">/* ronto keyword00/div> >
());
r /examn lOtheng(23) FF8000">/* ronto keyword00/div> v> >
());
?>pronto keyword007)/div> >

Ov> > v> A (sp;dos    9) iv> " [2]=> 4.7sp;dos    91 iv> > a: :sp;dosn.header irá imprimir: uetorlass=120539ref">s_sent &raqvss="note"nction.headVu120539re height="24" al='add avss=BR/functiohea120539.php.nn.headers-list" class="re.php.vss==u href="httV Heup! HTTP rese.php?sec-vss=u">up class="refnamedivnction.headVd120539re height="24" al='add avss=BR/functiohea120539.php.nn.headers-list" class="re.php.vss==menthref="httV Hement! HTTP rese.php?sec-vss=lisment class="refnamedivnction.ss="refsp> yrlass=V120539rref="htt100% liked="is...re heig3ut-content">

ahp?l a t jasnyemet alasem>an style="car2.pveis e genanchor"="24" a#120539ref&> 10 m Bahreagoan style="cref='/manualiv>
<?php

item claunctn you'ionrunnAudio F fromd="uscllectionVdpanempty" id=". item v> To s ctio>hea`xdebug_get> `unctn oVd="uscli.tv>
?>pronto keyword00= nt-type: pronto p"> ?>pronto keyword007) === nt-type: pronto adiv> r /eli'e#0000BB">?>pronto keyword00? nt-type: pronto p"> #0000BB">?>pronto keyword007) : nt-type: pronto p"> ?>pronto keyword007)div> >

O exemplo acima irá imprimir: uetorlass=109395ref">s_sent &raqvss="note"nction.headVu109395re height="24" al='add avss=BR/functiohea109395.php.nn.headers-list" class="re.php.vss==u href="httV Heup! HTTP rese.php?sec-vss=u">up class="refnamedivnction.headVd109395re height="24" al='add avss=BR/functiohea109395.php.nn.headers-list" class="re.php.vss==menthref="httV Hement! HTTP rese.php?sec-vss=lisment class="refnamedivnction.ss="refsp> yrlass=V109395renthref=52% liked="is...re heig1ut-content">

?>eadertento keyword007) : nt-type: pronto_());
>());
?>pronto keyword00= nt-type: pronto p"> ?>pronto ke >());
?>pronto keyword00= nt-type: pe:mref="funn());
/* ronto k >());
?>pronto keyword00= nt-type: fals?>ronto keyword >());
?>a ad$">());
>());
#0000BB">?>pnbsp;ad$">
());
?>) { iv> >());
?>pronto keyword00= nt-type: pronto p"> ());
v> >

O exemplo acima irá imprimir:á imprimss=Hcom12053footredirect=http://fr2.php.net/manual/pt_BR/function.headers-list.php">add a note

p.ne nge-language"> ers-it-bug"> aphp'com1205'nge-lan/dt>'s-it-b-it-bug"> tion">
httclassdnsra raw Hon.ss="classdnsra">classdnsracumentation/sssssssssssssssss"/l> httcloselog raw Hon.ss="closelog">closelogcumentation/sssssssssssssssss"/l> httn/cont-syslog-al/en/securit Hon.ss="n/cont_​syslog_​al/en/secse./cont_​syslog_​al/en/seccumentation/sssssssssssssssss"/l> httnns-class-> httnns-="/smxplication/atonns_​p"> ​mxse.ns_​p"> ​mxcumentation/sssssssssssssssss"/l> httnns-="/s> ​> ​> httfsockearcplication/atofsockearcspfsockearccumentation/sssssssssssssssss"/l> httgnt">stby rea raw Hon.ss="gnt">stby rea">gnt">stby reacumentation/sssssssssssssssss"/l> httgnt">stby#hei raw Hon.ss="gnt">stby#heighgnt">stby#heicumentation/sssssssssssssssss"/l> httgnt">stby#heil raw Hon.ss="gnt">stby#heilghgnt">stby#heilcumentation/sssssssssssssssss"/l> httgnt">st#hei raw Hon.ss="gnt">st#heighgnt">st#heicumentation/sssssssssssssssss"/l> httgntmxra raw Hon.ss="gntmxraghgntmxracumentation/sssssssssssssssss"/l> httgntpen/sby#hei raw Hon.ss="gntpen/sby#heighgntpen/sby#heicumentation/sssssssssssssssss"/l> httgntpen/sby#ude.p raw Hon.ss="gntpen/sby#ude.phpgntpen/sby#ude.pcumentation/sssssssssssssssss"/l> httgntass=by#hei raw Hon.ss="gntass=by#heihpgntass=by#heicumentation/sssssssssssssssss"/l> httgntass=byaders-li Hon.ss="gntass=byd="topgntass=byd="tcumentation/sssssssssssssssss"/l> htta notes> htta notes> htta notes-li Hon.ss="prontov pronto pmentation/sssssssssssssssss"/l> htta notess" href="hton.ss="prontos_​unctioprontos_​unctcumentation/sssssssssssssssss"/l> htta note/a> - Checkson.ss="prontos_​s htta_response_code() - on.ss="pan><​> <​c000BBpan><​> <​c000cumentation/sssssssssssssssss"/l> httin"/sntop/a> - on.ss="in"/<​nss="bin"/<​nss=cumentation/sssssssssssssssss"/l> httin"/spton/a> - on.ss="in"/<​pton"bin"/<​ptoncumentation/sssssssssssssssss"/l> httip2long raw Hon.ss="ip2long"bip2longcumentation/sssssssssssssssss"/l> httlong2ip/a> - on.ss="long2ip">long2ipcumentation/sssssssssssssssss"/l> httearclog raw Hon.ss="earclog">earclogcumentation/sssssssssssssssss"/l> httpfsockearcplication/atopfsockearcsppfsockearccumentation/sssssssssssssssss"/l> htt/a> - Envia um ion/ato/a> - Envyle="color: #mentation/sssssssssssssssss"/l> htt/a>raw - Envia um ion/ato/a>raw - Envyle="raw - Env #mentation/sssssssssssssssss"/l> htt/ock"/s="/sap?sitia um ion/ato/ock"/_​p"> ​ap?sityleock"/_​p"> ​ap?sit #mentation/sssssssssssssssss"/l> htt/ock"/se="-ct1-fing raw Hon.ss="eock"/_​s"/_​ct1-fingyleock"/_​s"/_​ct1-fing #mentation/sssssssssssssssss"/l> htt/ock"/se="-timeout raw Hon.ss="eock"/_​s"/_​timeoutyleock"/_​s"/_​timeout #mentation/sssssssssssssssss"/l> htt/yslog raw Hon.ss="eyslogyleyslog #mentation/sssssssssssssssss"/l> s-it class="refnamedrow-fluid clastion"> "/copyrighTfunctiCopyrighT © 20 Hyp017 Then youGro.php?s"/l> "/myfunctiMy+xml" hrhp?s"/l> "/00BB"cTfunctiCoBB"cThp?s"/l> "/siy.hidin+xml" hr siy.hhp?s"/l> "/micurity.gltiMicuri siy.hhp?s"/l> "/privacyfunctiPrivacy policyhp?s"/l> /ajax/l>bs/j "d00/div> heiggle-over0ay">
r0ay