apache_response_headers
(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)
apache_response_headers — 獲得全部 HTTP 響應頭資訊
說明
apache_response_headers(): array|false
獲得全部 HTTP 響應頭資訊。 可在 Apache、FastCGI、CLI、FPM 模式下執行。
參數
此函式沒有參數。
返回值
成功時返回包含全部 Apache 響應頭資訊的陣列, 或者在失敗時返回 false
.
範例
示例 #1 apache_response_headers() 示例
<?php
print_r(apache_response_headers());
?>
以上例程的輸出類似於:
Array ( [Accept-Ranges] => bytes [X-Powered-By] => PHP/4.3.8 )
參見
- apache_request_headers() - 獲取全部 HTTP 請求頭資訊
- headers_sent() - 檢測 HTTP 頭是否已經發送
- headers_list() - 返回已發送的 HTTP 響應頭(或準備發送的)