컴

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

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

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,714
PHP 17-01-03 조회 2,830
PHP 17-01-03 조회 2,834
PHP 17-01-03 조회 2,821
PHP 17-01-02 조회 3,210
PHP 17-01-02 조회 2,750
PHP 17-01-02 조회 2,468
PHP 17-01-02 조회 5,698
PHP 17-01-01 조회 2,439
PHP 17-01-01 조회 2,575
PHP 17-01-01 조회 2,562
기타 16-12-31 조회 3,392
PHP 16-12-30 조회 2,716
PHP 16-12-30 조회 2,937
PHP 16-12-30 조회 3,337
PHP 16-12-29 조회 3,043
PHP 16-12-29 조회 3,531
PHP 16-12-29 조회 2,978
PHP 16-12-28 조회 2,592
PHP 16-12-28 조회 2,938
PHP 16-12-28 조회 3,046
PHP 16-12-27 조회 5,560
PHP 16-12-27 조회 3,008
PHP 16-12-27 조회 2,614
PHP 16-12-26 조회 3,234
PHP 16-12-26 조회 2,576
PHP 16-12-26 조회 2,653
PHP 16-12-23 조회 4,000
PHP 16-12-23 조회 2,771
PHP 16-12-23 조회 3,668