Code666 (代码贴、代码片段)
创建
最近
趋势
关于
[PHP] PHP header返回http头类型大全 header( Content-T →→→→→
进入此内容的聊天室
来自 , 2019-06-14, 写在 PHP, 查看 122 次.
URL
http://www.code666.cn/view/3f5ee243
下载便签
或
查看源码
—
扩张便签
来填满整个浏览器
//定义编码
header
(
Content
-
Type
:
text
/
html
;
charset
=
utf
-
8
)
;
//Atom
header
(
Content
-
type
:
application
/
atom
+
xml
)
;
//CSS
header
(
Content
-
type
:
text
/
css
)
;
//Javascript
header
(
Content
-
type
:
text
/
javascript
)
;
//JPEG Image
header
(
Content
-
type
:
image
/
jpeg
)
;
//JSON
header
(
Content
-
type
:
application
/
json
)
;
//PDF
header
(
Content
-
type
:
application
/
pdf
)
;
//RSS
header
(
Content
-
Type
:
application
/
rss
+
xml
;
charset
=
ISO
-
8859
-
1
)
;
//Text (Plain)
header
(
Content
-
type
:
text
/
plain
)
;
//XML
header
(
Content
-
type
:
text
/
xml
)
;
// ok
header
(
HTTP
/
1.1
200
OK
)
;
//设置一个404头:
header
(
HTTP
/
1.1
404
Not Found
)
;
//设置地址被永久的重定向
header
(
HTTP
/
1.1
301
Moved Permanently
)
;
//转到一个新地址
header
(
Location
:
http
:
//www.example.org/ );
//文件延迟转向:
header
(
Refresh
:
10
;
url
=
http
:
//www.example.org/ );
print
You will be redirected in
10
seconds
;
//当然,也可以使用html语法实现
// <meta http-equiv="refresh" content="10;http://www.example.org/ />
// override X-Powered-By: PHP:
header
(
X
-
Powered
-
By
:
PHP
/
4
.
4
.
0
)
;
header
(
X
-
Powered
-
By
:
Brain
/
0
.
6b
)
;
//文档语言
header
(
Content
-
language
:
en
)
;
//告诉浏览器最后一次修改时间
$time
=
time
(
)
-
60
;
// or filemtime($fn), etc
header
(
Last
-
Modified
:
.
gmdate
(
D
,
d M Y H
:
i
:
s
,
$time
)
.
GMT
)
;
//告诉浏览器文档内容没有发生改变
header
(
HTTP
/
1.1
304
Not Modified
)
;
//设置内容长度
header
(
Content
-
Length
:
1234
)
;
//设置为一个下载类型
header
(
Content
-
Type
:
application
/
octet
-
stream
)
;
header
(
Content
-
Disposition
:
attachment
;
filename
=
"example.zip"
)
;
header
(
Content
-
Transfer
-
Encoding
:
binary
)
;
// load the file to send:
readfile
(
example
.
zip
)
;
// 对当前文档禁用缓存
header
(
Cache
-
Control
:
no
-
cache
,
no
-
store
,
max
-
age
=
0
,
must
-
revalidate
)
;
header
(
Expires
:
Mon
,
26
Jul
1997
05
:
00
:
00
GMT
)
;
// Date in the past
header
(
Pragma
:
no
-
cache
)
;
//设置内容类型:
header
(
Content
-
Type
:
text
/
html
;
charset
=
iso
-
8859
-
1
)
;
header
(
Content
-
Type
:
text
/
html
;
charset
=
utf
-
8
)
;
header
(
Content
-
Type
:
text
/
plain
)
;
//纯文本格式
header
(
Content
-
Type
:
image
/
jpeg
)
;
//JPG***
header
(
Content
-
Type
:
application
/
zip
)
;
// ZIP文件
header
(
Content
-
Type
:
application
/
pdf
)
;
// PDF文件
header
(
Content
-
Type
:
audio
/
mpeg
)
;
// 音频文件
header
(
Content
-
Type
:
application
/
x
-
shockw
**
e
-
flash
)
;
//Flash动画
//显示登陆对话框
header
(
HTTP
/
1.1
401
Unauthorized
)
;
header
(
WWW
-
Authenticate
:
Basic realm
=
"Top Secret"
)
;
print
Text that will be displayed
if
the user hits cancel or
;
print
enters wrong login data
;
回复 "PHP header返回http头类型大全 header( Content-T"
这儿你可以回复上面这条便签
作者
你的名字是?
标题
给你的便签一个标题。
语言
你的便签是以
Plain Text
HTML5
CSS
JavaScript
PHP
Python
Ruby
Lua
Bash
Erlang
Go
C
C++
Diff-output
LaTeX
SQL
XML
-----------------
4CS
MOS 6502
MOS 6502 Kick Assembler
MOS 6502 TASM/64TASS
Motorola 68000 Devpac Assembler
ABAP
Actionscript
ActionScript3
Ada
AIMMS
ALGOL 68
Apache
AppleScript
Apt sources.list
ARM Assembler
x86 Assembler
asymptote
ASP
autoconf
Autohotkey
AutoIT
AviSynth
Awk
BASCOM AVR
Basic4GL
BBCode
Brainfuck
BibTeX
BlitzBasic
BNF (Backus-Naur form)
Boo
C (for LoadRunner)
C for Macs
C with WiAPI
CAD DCL (Dialog Control Language)
AutoCAD/IntelliCAD Lisp
CFDG
ColdFusion
ChaiScript
Chapel
CIL (Common Intermediate Language)
Clojure
CMake
COBOL
CoffeeScript
C++ with WinAPI
C#
Cuesheet
D
Dart
DCS
DCL
DCPU/16 Assembly
Delphi (Object Pascal)
DIV
DOS
dot
E
ECMAScript
Eiffel
Email (mbox/eml/RFC format)
Enerscript
Euphoria
EZT
Formula One
Falcon
fo
Fortran
FreeBasic
FreeSWITCH
F#
GAMBAS
GDB
Genero
Genie
GNU Gettext .po/.pot
glSlang
GML
Gnuplot script
Groovy
GwBasic
Haskell
Haxe
HicEst
HQ9+
HTML 4.01 strict
Icon
Unoidl
INI
Inno Script
INTERCAL
Io
ISPF Panel
J
Java
Java 5
Job Control Language
jQuery 1.3
KLone with C
KLone with C++
Kotlin
Liberty BASIC
LDIF
Generic Lisp
LLVM
Locomotive Basic (Amstrad CPC series)
Logcat
Logtalk
LOLcode
@Formula/@Command
LotusScript
Lightwave Script
Linden Scripting
Motorola 68000 Assembler
MagikSF
Make
MapBasic
Matlab M-file
mIRC Scripting
MMIX Assembler
Modula-2
Modula-3
Microchip Assembler
MXML
MySQL
Nagios
NetRexx
newLISP
nginx
Nimrod
Nullsoft Scriptable Install System
Oberon-2
Objective-C
Objeck Programming Language
OCaml (Objective Caml)
GNU Octave M-file
OpenOffice.org Basic
ooRexx
Oracle 11i
Oracle 8
Delphi Prism (Oxygene)
Oz
ParaSail
PARI/GP
Pascal
PCRE
Per (forms)
Perl
Perl 6
OpenBSD packet filter
PIC16 Assembler
Pike
Pixel Bender 1.0
PL/I
Oracle 9.2 PL/SQL
PostgreSQL
Postscript
Povray
PowerBuilder (PowerScript)
PowerShell
ProFTPd
Progress
Prolog
Property
ProvideX
PureBasic
Python for S60
q/kdb+
QBasic/QuickBASIC
QML
Racket
Ruby (with Ruby on Rails Framework)
RBS Script
Rebol
Microsoft Registry Editor
Rexx
robots.txt
RPM Spec
R
Rust
SAS
Scala
Scheme
SciLab
SCL
sdlBasic
Smalltalk
Smarty template
SPARK
SPARQL
StandardML
StoneScript
SystemVerilog IEEE 1800-2009(draft8)
TCL/iTCL
Tera Term Macro
thinBasic
T-SQL
TypoScript
Unicon
UnrealScript
UPC
Urbi
Vala
Visual Basic
VB.NET
VBScript
Vedit macro language
Verilog
VHDL
Vim scripting
Visual FoxPro
Visual Prolog
Whitespace
Whois response (RPSL format)
WinBatch
XBasic
xorg.conf
Axapta/Dynamics Ax X++
YAML
ZiLOG Z80 Assembler
ZXBasic
你的便签
在这儿输入便签内容
//定义编码 header( Content-Type:text/html;charset=utf-8 ); //Atom header( Content-type: application/atom+xml ); //CSS header( Content-type: text/css ); //Javascript header( Content-type: text/javascript ); //JPEG Image header( Content-type: image/jpeg ); //JSON header( Content-type: application/json ); //PDF header( Content-type: application/pdf ); //RSS header( Content-Type: application/rss+xml; charset=ISO-8859-1 ); //Text (Plain) header( Content-type: text/plain ); //XML header( Content-type: text/xml ); // ok header( HTTP/1.1 200 OK ); //设置一个404头: header( HTTP/1.1 404 Not Found ); //设置地址被永久的重定向 header( HTTP/1.1 301 Moved Permanently ); //转到一个新地址 header( Location: http://www.example.org/ ); //文件延迟转向: header( Refresh: 10; url=http://www.example.org/ ); print You will be redirected in 10 seconds ; //当然,也可以使用html语法实现 //
创建短链接
创建一个较短的URL,连接到这个便签
私人
私人便签不会显示在最近列表中
保存期限
我们应该什么时候删除这张便签?
阅后即焚
五分钟
一小时
一天
一周
一月
一年
永久保留
防滥用
键入这些字符
创建