Created
June 26, 2012 21:31
-
-
Save mbunge/2999250 to your computer and use it in GitHub Desktop.
Display a converted raw http message
This file contains 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
<?php | |
/** | |
* @author Marco Bunge | |
* @copyright 2012 Marco Bunge <[email protected]> | |
*/ | |
$string = 'HTTP/1.1 200 OK | |
Server: Apache/1.3.29 (Unix) PHP/4.3.4 | |
Content-Length: (Größe von infotext.html in Byte) | |
Content-Language: de (nach RFC 3282 sowie RFC 1766) | |
Connection: close | |
Content-Type: text/html | |
(Inhalt von infotext.html) | |
hallo du. | |
ich bin eine msg!'; | |
$startBody = false; | |
foreach (explode("\r\n", $string) as $output) { | |
if (empty($output)) { | |
$startBody = true; | |
} | |
if ($startBody) | |
echo $output; | |
else | |
header($output); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment