Re: strip http headers
| From: | Ernest E Vogelsinger | Date: | Fri, 28 Feb 2003 15:55:56 +0000 |
| Subject: | Re: strip http headers | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-137578@lists.php.net to get a copy of this message | ||
At 16:46 28.02.2003, Diana Castillo spoke out and said:
--------------------[snip]--------------------
>is there any predefined procedure to strip http headers from a response?
--------------------[snip]--------------------
A valid HTTP response is a MIME message comprised of two parts - the header
block, and the data block. Both blocks are separated by a single empty newline.
You can easily split them using something like this (untested):
list(header, body) = preg_split("/(\r\n|\n\r|\r|\n){2,2}/s", $message, 2);
This should catch all possible variations of newlines. The correct newline
sequence afaik is "\r\n".
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/