headers_list — 보내진 (또는 보낼 준비가 된) 응답 헤더 목록을 반환합니다.

· 2016-12-27 (화) 11:39:47 · 2991

headers_list — 보내진 (또는 보낼 준비가 된) 응답 헤더 목록을 반환합니다.

 

설명 :

array headers_list ( void )

headers_list ()는 브라우저 / 클라이언트에 보낼 헤더 목록을 반환합니다. 이 헤더가 아직 전송되었는지 여부를 확인하려면 headers_sent ()를 사용하십시오.

 

반환값 :

헤더로 수치 적으로 배열 된 배열을 반환합니다.

 

예제 :

<?php

 

/* setcookie() will add a response header on its own */

setcookie('foo', 'bar');

 

/* Define a custom response header

   This will be ignored by most clients */

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

 

/* Specify plain text content in our response */

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

 

/* What headers are going to be sent? */

var_dump(headers_list());

 

?>

 

위 예제의 출력:

 

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"

}

 

|
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

5,403건

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
PHP 17-01-03 조회 3,688
PHP 17-01-03 조회 2,818
PHP 17-01-03 조회 2,820
PHP 17-01-03 조회 2,813
PHP 17-01-02 조회 3,189
PHP 17-01-02 조회 2,740
PHP 17-01-02 조회 2,459
PHP 17-01-02 조회 5,675
PHP 17-01-01 조회 2,428
PHP 17-01-01 조회 2,560
PHP 17-01-01 조회 2,547
기타 16-12-31 조회 3,377
PHP 16-12-30 조회 2,705
PHP 16-12-30 조회 2,915
PHP 16-12-30 조회 3,311
PHP 16-12-29 조회 3,021
PHP 16-12-29 조회 3,508
PHP 16-12-29 조회 2,946
PHP 16-12-28 조회 2,586
PHP 16-12-28 조회 2,924
PHP 16-12-28 조회 3,022
PHP 16-12-27 조회 5,548
PHP 16-12-27 조회 2,992
PHP 16-12-27 조회 2,604
PHP 16-12-26 조회 3,221
PHP 16-12-26 조회 2,569
PHP 16-12-26 조회 2,645
PHP 16-12-23 조회 3,982
PHP 16-12-23 조회 2,756
PHP 16-12-23 조회 3,652