PHP 헤더 함수 상세 설명
인 코딩 설정,HTTP 상태 값 보 내기,방향 바 꾸 기 등 을 사용 합 니 다.
php header utf8 :
header(“Content-type: text/html; charset=utf-8″);
php header 404 :
header(“HTTP/1.0 404 Not Found”);
이 두 가지 예 는 UTF 8 인 코딩 설정 과 404 상태 발송 이다.
헤더 재 설정:
header(‘Location: http://www.phpthinking.com');
기타 자주 사용 하 는 Header 사용법:
//Header 는 영구적 으로 방향 을 바 꾸 고 보통 301 은 header Location 와 함께 사용 합 니 다.
header(‘HTTP/1.1 301 Moved Permanently');
header(‘Location: http://www.phpthinking.com/');
//헤더 가 지연 되 어 페이지 를 새로 고 칩 니 다.
// HTML <meta http-equiv=”refresh” content=”10;http://www.phpthinking.com” />
header(‘Refresh: 10; url=http://www.phpthinking.com/');
//헤더 설정 페이지 언어
header(‘Content-language: en');
//다운로드 페이지 에 대해 파일 형식 과 파일 이름 을 설명 할 수 있 습 니 다.
header(‘Content-Type: application/octet-stream');
header(‘Content-Disposition: attachment; filename=”filename.zip”‘);
header(‘Content-Transfer-Encoding: binary');
//헤더 설정 캐 시 와 캐 시 만 료 시간
header(‘Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
header(‘Expires: Mon, 26 Jul 1997 05:00:00 GMT');
//헤더 설정 페이지 인 코딩:
header(‘Content-Type: text/html; charset=utf-8′);
여기 서 PHP 의 header 함수 에 대한 상세 한 설명 을 소개 합 니 다.더 많은 PHP 의 header 함수 내용 은 우리 의 이전 글 을 검색 하거나 아래 의 관련 글 을 계속 찾 아 보 세 요.앞으로 많은 응원 바 랍 니 다!
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
laravel에 yo에서 angularJs&coffeescript를 사용할 수 있도록 한다.먼저 yo 명령을 사용할 수 있어야하므로 아래에서 설치 global에 설치한 곳에서 laravel의 프로젝트 루트로 이동. 클라이언트 코드를 관리하는 디렉토리를 만들고 이동합니다. 클라이언트 환경 만들기 이것으로 히...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.