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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux