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

php 施用过的Header收集

WBOY
WBOYOriginal
2016-06-13 13:13:26789browse

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;
}




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);




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


Statement:
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