HOW TO: How can I retrieve the HTTP Response Headers

From: Date: Tue, 29 Jan 2002 12:51:39 +0000
Subject: HOW TO: How can I retrieve the HTTP Response Headers
Groups: php.general 
Request: Send a blank email to php-general+get-82557@lists.php.net to get a copy of this message
Hello guys, I asked that before, but I will explain my problem with more details. How can I retrieve the HTTP Response Headers using iPlanet or an independent SAPI function? Does these variables could come in any $HTTP_*_VARS or $_*? In Apache we have a function called getallheaders(), but this functions only returns the HTTP Request Headers, I need the HTTP Response Headers and it works only under Apache. For example, suppose there is a function called getallresponseheaders() that is independent of the Web Server (in fact I did one that just works under apache, because it is similar to the getallheaders()) If I write a script like this: <? header("TEST_HEADER: TEST_VALUE"); var_dump(getallresponseheaders()); ?> I would like to have a result like this: array(2) { ["X-Powered-By"]=> string(12) "PHP/4.0.3pl1" ["TEST_HEADER"]=> string(10) "TEST_VALUE" } If anyone has any tip, please, don’t worry to write. A whole project that is already done is dependent of just this feature. Thanks a lot Novello

« previous php.general (#82557) next »