Re[2]: [PHP] HTTP Header Viewer... Do I need regexps?

From: Date: Thu, 29 Apr 2004 00:34:27 +0000
Subject: Re[2]: [PHP] HTTP Header Viewer... Do I need regexps?
References: 1 2  Groups: php.general php.windows 
Request: Send a blank email to php-general+get-184909@lists.php.net to get a copy of this message
Hi, Thursday, April 29, 2004, 10:08:27 AM, you wrote: TR> The header has line breaks you will need to nl2br() to view them in TR> html TR> -- TR> regards, TR> Tom This should split up the header for you: $http = "HTTP/1.1 200 OK\r\nDate: Tue, 20 Apr 2004 17:28:23 GMT\r\nServer: Microsoft-IIS/5.0\r\nLast-modified: Thu, 01 Jan 2004 19:56:39 GMT\r\nConnection: close\r\nContent-type: text/html\r\n"; preg_match_all('!.*?\sOK|\s([\w\-]+):\s(.*?)$!mis',$http,$match); echo '<pre>'.print_r($match,1).'</pre>'; -- regards, Tom

« previous php.general (#184909) next »