Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55334 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34632 invoked from network); 9 Sep 2011 15:56:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Sep 2011 15:56:48 -0000 X-Host-Fingerprint: 96.2.18.191 host-191-18-2-96.midco.net Date: Fri, 09 Sep 2011 11:56:46 -0400 Received: from [96.2.18.191] ([96.2.18.191:6370] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 00/10-33036-E373A6E4 for ; Fri, 09 Sep 2011 11:56:46 -0400 Message-ID: <00.10.33036.E373A6E4@pb1.pair.com> To: internals@lists.php.net References: User-Agent: slrn/pre1.0.0-18 (Linux) X-Posted-By: 96.2.18.191 Subject: Re: Are all HTTP headers registered in SERVER? From: weierophinney@php.net (Matthew Weier O'Phinney) On 2011-09-08, Karoly Negyesi wrote: > It seems to be the case but this is not documented anywhere on > php.net. Instead > http://php.net/manual/en/function.apache-request-headers.php say "You > can also get at the value of the common CGI variables by reading them > from the environment". > > This comment http://www.php.net/manual/en/reserved.variables.server.php#87195 > from 2008 concurs. Zend and Symphony both seems to be happy to read > even X- custom headers from SERVER without bothering with > apace_request_headers() or anything like that. The reason is that this is the only truly portable way to get the headers, and it's easier to write a single implementation rather than multiple ones. That said, I'd really love to have a method in PHP for retrieving request headers, either singly or as a list. Having to parse through $_SERVER has always felt hackish. -- Matthew Weier O'Phinney Project Lead | matthew@zend.com Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc