Skip to content

Instantly share code, notes, and snippets.

@lucabrunox
Created October 14, 2013 15:19
Show Gist options
  • Save lucabrunox/6977315 to your computer and use it in GitHub Desktop.
Save lucabrunox/6977315 to your computer and use it in GitHub Desktop.
Parse HTTP headers in PHP.
$header = "...";
$parsed = array_map(function($x) { return array_map("trim", explode(":", $x, 2)); },array_filter(array_map("trim", explode("\n", $header))));
@lucabrunox
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment