![]() Preserved Topic: Separating HTTP headers from content (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: New Jersey, USA |
![]() I know this is going to be one of those slap myself in the forehead and say duh when I hear the answer, but I've been trying to figure this out for a while and I'm just not seeing it. code: <?php
|
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
![]() It would depend on the type of file - with a HTML file you could just grab everything between the HTML tags but as you are looking at XML/RSS then you could grab everything after the opening XML tag. So if you were to put it all in a string ($input): code: eregi("<?xml (.*)", $input, $output);
code: while (!feof($fp)) {
|
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
![]() For those wondering what a Here Document is (like butcher |
Paranoid (IV) Inmate From: Lebanon |
![]() Butcher, as far as i remember (<-- AFAIR ? |
Paranoid (IV) Inmate From: New Jersey, USA |
![]() Thanks lallous, I wasn't sure if that was done universally enough to rely on, but I guess it's really the standard. |
Paranoid (IV) Inmate From: New Jersey, USA |
![]() And... |
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
![]() lallous: Great idea. I think it might be: |
Paranoid (IV) Inmate From: Lebanon |
![]() butcher, check this out: http://www.sloppycode.net/sloppycode/PHP/cs17.html code: function _stripResponseHeader($source)
|
Paranoid (IV) Inmate From: New Jersey, USA |
![]() Cool!! |
Paranoid (IV) Inmate From: New Jersey, USA |
![]() Okay, one last question on this. code: fputs ($fp, "GET /cgi-local/page?c=Jokes&o=xml_1 HTTP/1.1\r\nHost: p.moreover.com If-Modified-Since: Sun, 22 Sep 2002 07:48:00 GMT\r\n\r\n"); I get some extra characters returned that are after the \r\n\r\n and just before the content starts. There is also a 0 at the end of the results. |