array headers_list ( void )
(PHP 5)

headers_list 함수는 브라우저나 클라이언트로 전송한 헤더정보를 반환하는 함수입니다. 헤더가 이미 전송되었다면 목록을 만들어 보여줄 것입니다.

<?php
 setcookie('foo', 'bar');

 header("X-Sample-Test: foo");

 header('Content-type: text/plain');

 print_r(headers_list());

 /*
 결과: 
 Array
 (
    [0] => X-Powered-By: PHP/5.2.13
    [1] => Set-Cookie: foo=bar
    [2] => X-Sample-Test: foo
    [3] => Content-type: text/plain
 )
 */
 ?>

0 댓글