Created
October 14, 2013 15:19
-
-
Save lucabrunox/6977315 to your computer and use it in GitHub Desktop.
Parse HTTP headers in PHP.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$header = "..."; | |
$parsed = array_map(function($x) { return array_map("trim", explode(":", $x, 2)); },array_filter(array_map("trim", explode("\n", $header)))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Then http://php.net/manual/en/function.http-parse-headers.php if you have pecl_http.