Skip to content

Instantly share code, notes, and snippets.

@david4worx
Created February 25, 2014 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save david4worx/9206465 to your computer and use it in GitHub Desktop.
Save david4worx/9206465 to your computer and use it in GitHub Desktop.
<?php
$keys = array_filter(array_keys($_SERVER), function($v) { return 0 === strpos($v, 'HTTP_'); });
$keys = array_combine($keys, $keys);
$headers = array_intersect_key($_SERVER, $keys);
var_dump($headers);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment