|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-06-24 17:04 UTC] mike at brenden dot com
Description:
------------
startphp:
header('X-x: yes');
$ho=apache_response_headers();
echo '<p>HEADERS FROM MG</p>';
print_r($ho);
var_dump(headers_list());
:endphp
output from headers_list() shows only numeric indices and header-item name; it does not also show the header-item value (example: [0] element containts only 'X-x' but does not also contain colon, space and 'yes')
meanwhile, apache_response_headers() works as described.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 17:00:01 2025 UTC |
< ?php header('X-x: yes'); $hdrs=apache_request_headers(); echo '<p><b>apache_request_headers in</b></p>'; print_r($hdrs); $ho=apache_response_headers(); echo '<p><b>apache_response_headers out</b></p>'; print_r($ho); echo '<p><b>headers_list out</b></p>'; var_dump(headers_list()); echo '<p><b>sapi='. php_sapi_name(). '</b></p>'; ? > apache_request_headers in Array ( [Host] => pics.brenden.com [User-Agent] => Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4 [Accept] => text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 [Accept-Language] => en-us,en;q=0.5 [Accept-Encoding] => gzip,deflate [Accept-Charset] => ISO-8859-1,utf-8;q=0.7,*;q=0.7 [Keep-Alive] => 300 [Connection] => keep-alive [Cookie] => picss=d55dd48565ebbc0d0fdb74d527413a34 ) apache_response_headers out Array ( [X-x] => yes ) headers_list out array(2) { [0]=> string(3) "X-x" [1]=> string(12) "Content-type" } sapi=apache2handler