On 2011-09-08, Karoly Negyesi <kar...@negyesi.net> 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            | matt...@zend.com
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to