好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

php header()函数详细实用方法 - php函数

php header()函数详细实用方法

header(string,replace,http_response_code)

string 必需,规定要发送的报头字符串.

replace 可选,指示该报头是否替换之前的报头,或添加第二个报头.

默认是 true(替换),false(允许相同类型的多个报头).

http_response_code 可选,把 http 响应代码强制为指定的值,(php 4 以及更高版本可用)

跳转:

header('location: http://HdhCmsTestphpfensi测试数据/');发送http状态

header("status: 404 not found");

设置缓存:

header("expires:sat,26 jul 1997 05:00:00 gmt");

利用header做文件下载功能:

header( "content-type:application/pdf" ); // 文件将被称为 downloaded.pdf   header( "content-disposition:attachment;filename='downloaded.pdf'" ); // pdf 源在 original.pdf 中   readfile( "original.pdf" ); 

查看更多关于php header()函数详细实用方法 - php函数的详细内容...

  阅读:38次