Honestly, this was one of my more productive years. While I still haven’t gotten any further on either of my private projects (and in fact abandoned one of them, having been beaten to the punch by a startup this summer. You ambitious entrepeneurs should leave me some hobbies) , I did manage to [...]
Archive of entries posted on October 2007
Getting custom HTTP variables out of PHP
PHP 5.0 stores HTTP headers in the $_SERVER variable as key-value pairs. It mangles their field names, however, by:
prepending “HTTP_” to the key
replacing “-” with “_” in the key
uppercasing all letters
Say that your custom HTTP client sends X-Hello: World as a header. To retrieve the value (e.g. “world”) from PHP, the correct key [...]