note 79907 deleted from function.curl-exec by danbrown
| From: | danbrown@php.net | Date: | Mon, 04 Jan 2010 21:38:07 +0000 |
| Subject: | note 79907 deleted from function.curl-exec by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-164643@lists.php.net to get a copy of this message | ||
Note Submitter: aeon tech at g mail dot com
----
// easy way to parse raw http headers
function parse_http_headers($rawheaders)
{
$lines = explode("\n",$rawheaders);
if(substr($lines[0],0,5) == 'HTTP/')
{
$response = array_shift($lines);
}
foreach($lines as $line)
{
preg_match("/^(.+?):\s+(.+)$/",trim($line),$matches);
$headers[$matches[1]] = $matches[2];
unset($matches);
}
return $headers;
}