PHP头条
热点:

PHP header()函数常用方法


//定义编码

//Atom

//CSS

//Javascript

//JPEG Image

//JSON

//PDF

//RSS

//Text (Plain)

//XML

// ok

//设置一个404头:

//设置地址被永久的重定向

//转到一个新地址

//文件延迟转向:
print 'You will be redirected in 10 seconds';
//当然,也可以使用html语法实现
// <meta http-equiv="refresh" content="10;http://www.jbxue.com/ />
// override X-Powered-By: PHP:
header('X-Powered-By: Brain/0.6b');
//文档语言

//告诉浏览器最后一次修改时间
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $time).' GMT');
//告诉浏览器文档内容没有发生改变

//设置内容长度

//设置为一个下载类型
header('Content-Disposition: attachment; filename="example.zip"');
header('Content-Transfer-Encoding: binary');
// load the file to send:
readfile('example.zip');
// 对当前文档禁用缓存
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header('Pragma: no-cache');
//设置内容类型:
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('WWW-Authenticate: Basic realm="Top Secret"');
print 'Text that will be displayed if the user hits cancel or ';
print 'enters wrong login data';

www.phpzy.comtrue/php/8221.htmlTechArticlePHP header()函数常用方法 //定义编码 //Atom //CSS //Javascript //JPEG Image //JSON //PDF //RSS //Text (Plain) //XML // ok //设置一个404头: //设置地址被永久的重定向 //转到一个新地址 //文件延迟转向: print...

相关文章

相关频道:

PHP之友评论

今天推荐