在PHP中,可以通过`header()`函数来声明HTTP头部信息。以下是一些常见的HTTP头部信息及其使用实例:
| HTTP头部信息 | 作用描述 | PHP代码实例 |

|-----------------------|--------------------------------------------------------------------------|----------------------------------------------------------------------------------------|
| Content-Type | 设置发送给客户端的MIME类型,通常用于指定内容的格式,如HTML、XML等。 | `header('Content-Type: text/html; charset=utf-8');` |
| Status | 设置HTTP状态码,告知客户端请求的结果。 | `header('HTTP/1.1 200 OK');` |
| Location | 重定向请求到另一个URL。 | `header('Location: /new-page.html');` |
| Cache-Control | 控制缓存的策略,如是否允许缓存、缓存时间等。 | `header('Cache-Control: no-cache, must-revalidate');` |
| Expires | 设置内容的过期时间,之后客户端将不再从服务器请求该内容。 | `header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');` |
| Pragma | 兼容老旧HTTP缓存机制,与Cache-Control类似。 | `header('Pragma: no-cache');` |
| Set-Cookie | 向客户端发送一个Cookie。 | `header('Set-Cookie: name=value; path=/; expires=Sat, 01 Jan 2000 00:00:00 GMT');` |
| X-Powered-By | 设置响应头,表明服务器使用了PHP。 | `header('X-Powered-By: PHP/7.4.0');` |
| Content-Disposition | 设置内容为附件时,指定下载的文件名。 | `header('Content-Disposition: attachment; filename="









