Home > Backend Development > PHP Tutorial > php 施用过的Header收集

php 施用过的Header收集

WBOY
Release: 2016-06-13 13:13:26
Original
810 people have browsed it

php 使用过的Header收集
作者:zccst

1,Web
text/html=>html,htm
text/css=>css

text/plain=>text//重要


//(1)普通文本
header("Content-type:text/plain;charset=utf-8");
//例子
function response($arr){
	$json = json_encode($arr);
	header("Content-type:text/plain;charset=utf-8");
	print $json;
}

Copy after login



2,文档
application/msword=>doc
application/vnd.ms-powerpoint=>ppt
application/vnd.ms-excel=>xls
application/pdf=>pdf

application/zip=>zip
application/x-tar=>tar



//(1)导出csv格式
header("Content-type:text/csv;charset=utf-8");
header("Content-Disposition:filename={$title}.csv"); 
print iconv('utf-8', 'gb2312//IGNORE', $str);


Copy after login


3,图片
image/jpeg=>jpeg,jpg,jpe,png
image/gif=>gif
image/bmp=>bmp



4,音频
audio/x-wav=>wav
audio/mpeg=>mp3,mp2,mpga
audio/midi=>mid,midi,kar



5,视频
video/mpeg =>mpeg,mpg,mpe
video/quictime=>qt,mov
video/x-msvideo=>avi
video/x-sgi-movie=>movie


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template