判断客户端编码
1 | public static function get_os($agent = null) { |
页面输出
1 | header('HTTP/1.1 200 OK'); // ok 正常访问 |
内容输出
1 | header('Content-Type: text/html; charset=utf-8'); //网页编码 |
声明一个下载文件
1 | header('Content-Type: application/octet-stream'); |
对当前文档禁用缓存
1 | header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate'); |
身份认证
1 | header('HTTP/1.1 401 Unauthorized'); |
声明一个需要下载的xls文件
1 | header('Content-Disposition: attachment; filename=ithhc.xlsx'); |
download
1 | header("Content-type: application/force-download"); |