note 101894 added to function.http-parse-message
| From: | A dot S dot at osu1 dot php dot net | Date: | Sun, 16 Jan 2011 23:16:56 +0000 |
| Subject: | note 101894 added to function.http-parse-message | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-175808@lists.php.net to get a copy of this message | ||
Also, here is a modified version that will return the header as a string, and will include the
initial "HTTP/1.x" status lines in the header result:
function http_parse_response($string)
{
$header = null;
$header_values_begun = false;
$content = null;
$str = strtok($string, "\n");
$h = null;
while ($str !== false)
{
if ($h && trim($str) === '')
{
$h = false;
continue;
}
if ($h !== false)
{
$header .= $str."\n";
$h = strpos($str, ':') === false ? null : true;
}
if ($h === false)
{
$content .= $str."\n";
}
$str = strtok("\n");
}
return array($header, trim($content));
}
----
Server IP: 69.147.83.197
Probable Submitter: 173.166.142.162
----
Manual Page -- http://www.php.net/manual/en/function.http-parse-message.php
Edit -- https://master.php.net/note/edit/101894
Del: integrated -- https://master.php.net/note/delete/101894/integrated
Del: useless -- https://master.php.net/note/delete/101894/useless
Del: bad code -- https://master.php.net/note/delete/101894/bad+code
Del: spam -- https://master.php.net/note/delete/101894/spam
Del: non-english -- https://master.php.net/note/delete/101894/non-english
Del: in docs -- https://master.php.net/note/delete/101894/in+docs
Del: other reasons-- https://master.php.net/note/delete/101894
Reject -- https://master.php.net/note/reject/101894
Search -- https://master.php.net/manage/user-notes.php