note 66335 deleted from function.getallheaders by didou

From: Date: Mon, 31 Dec 2007 00:05:37 +0000
Subject: note 66335 deleted from function.getallheaders by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-134561@lists.php.net to get a copy of this message
Note Submitter: tigr at mail15 dot com ---- And even better one, that absolutely mimics getallheaders behaviour (including keynames - first character in each word is uppercase and words separated with '-' instead of underscore), and still does not use regexp: <?php function emu_getallheaders() { foreach($_SERVER as $name => $value) if(substr($name, 0, 5) == 'HTTP_') $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; return $headers; } ?>

« previous php.notes (#134561) next »